pci.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * arch/arm/mach-orion5x/pci.c
  4. *
  5. * PCI and PCIe functions for Marvell Orion System On Chip
  6. *
  7. * Maintainer: Tzachi Perelstein <[email protected]>
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/pci.h>
  11. #include <linux/slab.h>
  12. #include <linux/mbus.h>
  13. #include <video/vga.h>
  14. #include <asm/irq.h>
  15. #include <asm/mach/pci.h>
  16. #include <plat/pcie.h>
  17. #include <plat/addr-map.h>
  18. #include "common.h"
  19. #include "orion5x.h"
  20. /*****************************************************************************
  21. * Orion has one PCIe controller and one PCI controller.
  22. *
  23. * Note1: The local PCIe bus number is '0'. The local PCI bus number
  24. * follows the scanned PCIe bridged busses, if any.
  25. *
  26. * Note2: It is possible for PCI/PCIe agents to access many subsystem's
  27. * space, by configuring BARs and Address Decode Windows, e.g. flashes on
  28. * device bus, Orion registers, etc. However this code only enable the
  29. * access to DDR banks.
  30. ****************************************************************************/
  31. /*****************************************************************************
  32. * PCIe controller
  33. ****************************************************************************/
  34. #define PCIE_BASE (ORION5X_PCIE_VIRT_BASE)
  35. void __init orion5x_pcie_id(u32 *dev, u32 *rev)
  36. {
  37. *dev = orion_pcie_dev_id(PCIE_BASE);
  38. *rev = orion_pcie_rev(PCIE_BASE);
  39. }
  40. static int pcie_valid_config(int bus, int dev)
  41. {
  42. /*
  43. * Don't go out when trying to access --
  44. * 1. nonexisting device on local bus
  45. * 2. where there's no device connected (no link)
  46. */
  47. if (bus == 0 && dev == 0)
  48. return 1;
  49. if (!orion_pcie_link_up(PCIE_BASE))
  50. return 0;
  51. if (bus == 0 && dev != 1)
  52. return 0;
  53. return 1;
  54. }
  55. /*
  56. * PCIe config cycles are done by programming the PCIE_CONF_ADDR register
  57. * and then reading the PCIE_CONF_DATA register. Need to make sure these
  58. * transactions are atomic.
  59. */
  60. static DEFINE_SPINLOCK(orion5x_pcie_lock);
  61. static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
  62. int size, u32 *val)
  63. {
  64. unsigned long flags;
  65. int ret;
  66. if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
  67. *val = 0xffffffff;
  68. return PCIBIOS_DEVICE_NOT_FOUND;
  69. }
  70. spin_lock_irqsave(&orion5x_pcie_lock, flags);
  71. ret = orion_pcie_rd_conf(PCIE_BASE, bus, devfn, where, size, val);
  72. spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
  73. return ret;
  74. }
  75. static int pcie_rd_conf_wa(struct pci_bus *bus, u32 devfn,
  76. int where, int size, u32 *val)
  77. {
  78. int ret;
  79. if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
  80. *val = 0xffffffff;
  81. return PCIBIOS_DEVICE_NOT_FOUND;
  82. }
  83. /*
  84. * We only support access to the non-extended configuration
  85. * space when using the WA access method (or we would have to
  86. * sacrifice 256M of CPU virtual address space.)
  87. */
  88. if (where >= 0x100) {
  89. *val = 0xffffffff;
  90. return PCIBIOS_DEVICE_NOT_FOUND;
  91. }
  92. ret = orion_pcie_rd_conf_wa(ORION5X_PCIE_WA_VIRT_BASE,
  93. bus, devfn, where, size, val);
  94. return ret;
  95. }
  96. static int pcie_wr_conf(struct pci_bus *bus, u32 devfn,
  97. int where, int size, u32 val)
  98. {
  99. unsigned long flags;
  100. int ret;
  101. if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0)
  102. return PCIBIOS_DEVICE_NOT_FOUND;
  103. spin_lock_irqsave(&orion5x_pcie_lock, flags);
  104. ret = orion_pcie_wr_conf(PCIE_BASE, bus, devfn, where, size, val);
  105. spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
  106. return ret;
  107. }
  108. static struct pci_ops pcie_ops = {
  109. .read = pcie_rd_conf,
  110. .write = pcie_wr_conf,
  111. };
  112. static int __init pcie_setup(struct pci_sys_data *sys)
  113. {
  114. struct resource *res;
  115. struct resource realio;
  116. int dev;
  117. /*
  118. * Generic PCIe unit setup.
  119. */
  120. orion_pcie_setup(PCIE_BASE);
  121. /*
  122. * Check whether to apply Orion-1/Orion-NAS PCIe config
  123. * read transaction workaround.
  124. */
  125. dev = orion_pcie_dev_id(PCIE_BASE);
  126. if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
  127. printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
  128. "read transaction workaround\n");
  129. mvebu_mbus_add_window_by_id(ORION_MBUS_PCIE_WA_TARGET,
  130. ORION_MBUS_PCIE_WA_ATTR,
  131. ORION5X_PCIE_WA_PHYS_BASE,
  132. ORION5X_PCIE_WA_SIZE);
  133. pcie_ops.read = pcie_rd_conf_wa;
  134. }
  135. realio.start = sys->busnr * SZ_64K;
  136. realio.end = realio.start + SZ_64K - 1;
  137. pci_remap_iospace(&realio, ORION5X_PCIE_IO_PHYS_BASE);
  138. /*
  139. * Request resources.
  140. */
  141. res = kzalloc(sizeof(struct resource), GFP_KERNEL);
  142. if (!res)
  143. panic("pcie_setup unable to alloc resources");
  144. /*
  145. * IORESOURCE_MEM
  146. */
  147. res->name = "PCIe Memory Space";
  148. res->flags = IORESOURCE_MEM;
  149. res->start = ORION5X_PCIE_MEM_PHYS_BASE;
  150. res->end = res->start + ORION5X_PCIE_MEM_SIZE - 1;
  151. if (request_resource(&iomem_resource, res))
  152. panic("Request PCIe Memory resource failed\n");
  153. pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
  154. return 1;
  155. }
  156. /*****************************************************************************
  157. * PCI controller
  158. ****************************************************************************/
  159. #define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE + (x))
  160. #define PCI_MODE ORION5X_PCI_REG(0xd00)
  161. #define PCI_CMD ORION5X_PCI_REG(0xc00)
  162. #define PCI_P2P_CONF ORION5X_PCI_REG(0x1d14)
  163. #define PCI_CONF_ADDR ORION5X_PCI_REG(0xc78)
  164. #define PCI_CONF_DATA ORION5X_PCI_REG(0xc7c)
  165. /*
  166. * PCI_MODE bits
  167. */
  168. #define PCI_MODE_64BIT (1 << 2)
  169. #define PCI_MODE_PCIX ((1 << 4) | (1 << 5))
  170. /*
  171. * PCI_CMD bits
  172. */
  173. #define PCI_CMD_HOST_REORDER (1 << 29)
  174. /*
  175. * PCI_P2P_CONF bits
  176. */
  177. #define PCI_P2P_BUS_OFFS 16
  178. #define PCI_P2P_BUS_MASK (0xff << PCI_P2P_BUS_OFFS)
  179. #define PCI_P2P_DEV_OFFS 24
  180. #define PCI_P2P_DEV_MASK (0x1f << PCI_P2P_DEV_OFFS)
  181. /*
  182. * PCI_CONF_ADDR bits
  183. */
  184. #define PCI_CONF_REG(reg) ((reg) & 0xfc)
  185. #define PCI_CONF_FUNC(func) (((func) & 0x3) << 8)
  186. #define PCI_CONF_DEV(dev) (((dev) & 0x1f) << 11)
  187. #define PCI_CONF_BUS(bus) (((bus) & 0xff) << 16)
  188. #define PCI_CONF_ADDR_EN (1 << 31)
  189. /*
  190. * Internal configuration space
  191. */
  192. #define PCI_CONF_FUNC_STAT_CMD 0
  193. #define PCI_CONF_REG_STAT_CMD 4
  194. #define PCIX_STAT 0x64
  195. #define PCIX_STAT_BUS_OFFS 8
  196. #define PCIX_STAT_BUS_MASK (0xff << PCIX_STAT_BUS_OFFS)
  197. /*
  198. * PCI Address Decode Windows registers
  199. */
  200. #define PCI_BAR_SIZE_DDR_CS(n) (((n) == 0) ? ORION5X_PCI_REG(0xc08) : \
  201. ((n) == 1) ? ORION5X_PCI_REG(0xd08) : \
  202. ((n) == 2) ? ORION5X_PCI_REG(0xc0c) : \
  203. ((n) == 3) ? ORION5X_PCI_REG(0xd0c) : NULL)
  204. #define PCI_BAR_REMAP_DDR_CS(n) (((n) == 0) ? ORION5X_PCI_REG(0xc48) : \
  205. ((n) == 1) ? ORION5X_PCI_REG(0xd48) : \
  206. ((n) == 2) ? ORION5X_PCI_REG(0xc4c) : \
  207. ((n) == 3) ? ORION5X_PCI_REG(0xd4c) : NULL)
  208. #define PCI_BAR_ENABLE ORION5X_PCI_REG(0xc3c)
  209. #define PCI_ADDR_DECODE_CTRL ORION5X_PCI_REG(0xd3c)
  210. /*
  211. * PCI configuration helpers for BAR settings
  212. */
  213. #define PCI_CONF_FUNC_BAR_CS(n) ((n) >> 1)
  214. #define PCI_CONF_REG_BAR_LO_CS(n) (((n) & 1) ? 0x18 : 0x10)
  215. #define PCI_CONF_REG_BAR_HI_CS(n) (((n) & 1) ? 0x1c : 0x14)
  216. /*
  217. * PCI config cycles are done by programming the PCI_CONF_ADDR register
  218. * and then reading the PCI_CONF_DATA register. Need to make sure these
  219. * transactions are atomic.
  220. */
  221. static DEFINE_SPINLOCK(orion5x_pci_lock);
  222. static int orion5x_pci_cardbus_mode;
  223. static int orion5x_pci_local_bus_nr(void)
  224. {
  225. u32 conf = readl(PCI_P2P_CONF);
  226. return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
  227. }
  228. static int orion5x_pci_hw_rd_conf(int bus, int dev, u32 func,
  229. u32 where, u32 size, u32 *val)
  230. {
  231. unsigned long flags;
  232. spin_lock_irqsave(&orion5x_pci_lock, flags);
  233. writel(PCI_CONF_BUS(bus) |
  234. PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
  235. PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN, PCI_CONF_ADDR);
  236. *val = readl(PCI_CONF_DATA);
  237. if (size == 1)
  238. *val = (*val >> (8*(where & 0x3))) & 0xff;
  239. else if (size == 2)
  240. *val = (*val >> (8*(where & 0x3))) & 0xffff;
  241. spin_unlock_irqrestore(&orion5x_pci_lock, flags);
  242. return PCIBIOS_SUCCESSFUL;
  243. }
  244. static int orion5x_pci_hw_wr_conf(int bus, int dev, u32 func,
  245. u32 where, u32 size, u32 val)
  246. {
  247. unsigned long flags;
  248. int ret = PCIBIOS_SUCCESSFUL;
  249. spin_lock_irqsave(&orion5x_pci_lock, flags);
  250. writel(PCI_CONF_BUS(bus) |
  251. PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
  252. PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN, PCI_CONF_ADDR);
  253. if (size == 4) {
  254. __raw_writel(val, PCI_CONF_DATA);
  255. } else if (size == 2) {
  256. __raw_writew(val, PCI_CONF_DATA + (where & 0x3));
  257. } else if (size == 1) {
  258. __raw_writeb(val, PCI_CONF_DATA + (where & 0x3));
  259. } else {
  260. ret = PCIBIOS_BAD_REGISTER_NUMBER;
  261. }
  262. spin_unlock_irqrestore(&orion5x_pci_lock, flags);
  263. return ret;
  264. }
  265. static int orion5x_pci_valid_config(int bus, u32 devfn)
  266. {
  267. if (bus == orion5x_pci_local_bus_nr()) {
  268. /*
  269. * Don't go out for local device
  270. */
  271. if (PCI_SLOT(devfn) == 0 && PCI_FUNC(devfn) != 0)
  272. return 0;
  273. /*
  274. * When the PCI signals are directly connected to a
  275. * Cardbus slot, ignore all but device IDs 0 and 1.
  276. */
  277. if (orion5x_pci_cardbus_mode && PCI_SLOT(devfn) > 1)
  278. return 0;
  279. }
  280. return 1;
  281. }
  282. static int orion5x_pci_rd_conf(struct pci_bus *bus, u32 devfn,
  283. int where, int size, u32 *val)
  284. {
  285. if (!orion5x_pci_valid_config(bus->number, devfn)) {
  286. *val = 0xffffffff;
  287. return PCIBIOS_DEVICE_NOT_FOUND;
  288. }
  289. return orion5x_pci_hw_rd_conf(bus->number, PCI_SLOT(devfn),
  290. PCI_FUNC(devfn), where, size, val);
  291. }
  292. static int orion5x_pci_wr_conf(struct pci_bus *bus, u32 devfn,
  293. int where, int size, u32 val)
  294. {
  295. if (!orion5x_pci_valid_config(bus->number, devfn))
  296. return PCIBIOS_DEVICE_NOT_FOUND;
  297. return orion5x_pci_hw_wr_conf(bus->number, PCI_SLOT(devfn),
  298. PCI_FUNC(devfn), where, size, val);
  299. }
  300. static struct pci_ops pci_ops = {
  301. .read = orion5x_pci_rd_conf,
  302. .write = orion5x_pci_wr_conf,
  303. };
  304. static void __init orion5x_pci_set_bus_nr(int nr)
  305. {
  306. u32 p2p = readl(PCI_P2P_CONF);
  307. if (readl(PCI_MODE) & PCI_MODE_PCIX) {
  308. /*
  309. * PCI-X mode
  310. */
  311. u32 pcix_status, bus, dev;
  312. bus = (p2p & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS;
  313. dev = (p2p & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS;
  314. orion5x_pci_hw_rd_conf(bus, dev, 0, PCIX_STAT, 4, &pcix_status);
  315. pcix_status &= ~PCIX_STAT_BUS_MASK;
  316. pcix_status |= (nr << PCIX_STAT_BUS_OFFS);
  317. orion5x_pci_hw_wr_conf(bus, dev, 0, PCIX_STAT, 4, pcix_status);
  318. } else {
  319. /*
  320. * PCI Conventional mode
  321. */
  322. p2p &= ~PCI_P2P_BUS_MASK;
  323. p2p |= (nr << PCI_P2P_BUS_OFFS);
  324. writel(p2p, PCI_P2P_CONF);
  325. }
  326. }
  327. static void __init orion5x_pci_master_slave_enable(void)
  328. {
  329. int bus_nr, func, reg;
  330. u32 val;
  331. bus_nr = orion5x_pci_local_bus_nr();
  332. func = PCI_CONF_FUNC_STAT_CMD;
  333. reg = PCI_CONF_REG_STAT_CMD;
  334. orion5x_pci_hw_rd_conf(bus_nr, 0, func, reg, 4, &val);
  335. val |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
  336. orion5x_pci_hw_wr_conf(bus_nr, 0, func, reg, 4, val | 0x7);
  337. }
  338. static void __init orion5x_setup_pci_wins(void)
  339. {
  340. const struct mbus_dram_target_info *dram = mv_mbus_dram_info();
  341. u32 win_enable;
  342. int bus;
  343. int i;
  344. /*
  345. * First, disable windows.
  346. */
  347. win_enable = 0xffffffff;
  348. writel(win_enable, PCI_BAR_ENABLE);
  349. /*
  350. * Setup windows for DDR banks.
  351. */
  352. bus = orion5x_pci_local_bus_nr();
  353. for (i = 0; i < dram->num_cs; i++) {
  354. const struct mbus_dram_window *cs = dram->cs + i;
  355. u32 func = PCI_CONF_FUNC_BAR_CS(cs->cs_index);
  356. u32 reg;
  357. u32 val;
  358. /*
  359. * Write DRAM bank base address register.
  360. */
  361. reg = PCI_CONF_REG_BAR_LO_CS(cs->cs_index);
  362. orion5x_pci_hw_rd_conf(bus, 0, func, reg, 4, &val);
  363. val = (cs->base & 0xfffff000) | (val & 0xfff);
  364. orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, val);
  365. /*
  366. * Write DRAM bank size register.
  367. */
  368. reg = PCI_CONF_REG_BAR_HI_CS(cs->cs_index);
  369. orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, 0);
  370. writel((cs->size - 1) & 0xfffff000,
  371. PCI_BAR_SIZE_DDR_CS(cs->cs_index));
  372. writel(cs->base & 0xfffff000,
  373. PCI_BAR_REMAP_DDR_CS(cs->cs_index));
  374. /*
  375. * Enable decode window for this chip select.
  376. */
  377. win_enable &= ~(1 << cs->cs_index);
  378. }
  379. /*
  380. * Re-enable decode windows.
  381. */
  382. writel(win_enable, PCI_BAR_ENABLE);
  383. /*
  384. * Disable automatic update of address remapping when writing to BARs.
  385. */
  386. orion5x_setbits(PCI_ADDR_DECODE_CTRL, 1);
  387. }
  388. static int __init pci_setup(struct pci_sys_data *sys)
  389. {
  390. struct resource *res;
  391. struct resource realio;
  392. /*
  393. * Point PCI unit MBUS decode windows to DRAM space.
  394. */
  395. orion5x_setup_pci_wins();
  396. /*
  397. * Master + Slave enable
  398. */
  399. orion5x_pci_master_slave_enable();
  400. /*
  401. * Force ordering
  402. */
  403. orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
  404. realio.start = sys->busnr * SZ_64K;
  405. realio.end = realio.start + SZ_64K - 1;
  406. pci_remap_iospace(&realio, ORION5X_PCI_IO_PHYS_BASE);
  407. /*
  408. * Request resources
  409. */
  410. res = kzalloc(sizeof(struct resource), GFP_KERNEL);
  411. if (!res)
  412. panic("pci_setup unable to alloc resources");
  413. /*
  414. * IORESOURCE_MEM
  415. */
  416. res->name = "PCI Memory Space";
  417. res->flags = IORESOURCE_MEM;
  418. res->start = ORION5X_PCI_MEM_PHYS_BASE;
  419. res->end = res->start + ORION5X_PCI_MEM_SIZE - 1;
  420. if (request_resource(&iomem_resource, res))
  421. panic("Request PCI Memory resource failed\n");
  422. pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
  423. return 1;
  424. }
  425. /*****************************************************************************
  426. * General PCIe + PCI
  427. ****************************************************************************/
  428. /*
  429. * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
  430. * is operating as a root complex this needs to be switched to
  431. * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
  432. * the device. Decoding setup is handled by the orion code.
  433. */
  434. static void rc_pci_fixup(struct pci_dev *dev)
  435. {
  436. if (dev->bus->parent == NULL && dev->devfn == 0) {
  437. int i;
  438. dev->class &= 0xff;
  439. dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
  440. for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
  441. dev->resource[i].start = 0;
  442. dev->resource[i].end = 0;
  443. dev->resource[i].flags = 0;
  444. }
  445. }
  446. }
  447. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
  448. static int orion5x_pci_disabled __initdata;
  449. void __init orion5x_pci_disable(void)
  450. {
  451. orion5x_pci_disabled = 1;
  452. }
  453. void __init orion5x_pci_set_cardbus_mode(void)
  454. {
  455. orion5x_pci_cardbus_mode = 1;
  456. }
  457. int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
  458. {
  459. vga_base = ORION5X_PCIE_MEM_PHYS_BASE;
  460. if (nr == 0) {
  461. orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
  462. return pcie_setup(sys);
  463. }
  464. if (nr == 1 && !orion5x_pci_disabled) {
  465. orion5x_pci_set_bus_nr(sys->busnr);
  466. return pci_setup(sys);
  467. }
  468. return 0;
  469. }
  470. int __init orion5x_pci_sys_scan_bus(int nr, struct pci_host_bridge *bridge)
  471. {
  472. struct pci_sys_data *sys = pci_host_bridge_priv(bridge);
  473. list_splice_init(&sys->resources, &bridge->windows);
  474. bridge->dev.parent = NULL;
  475. bridge->sysdata = sys;
  476. bridge->busnr = sys->busnr;
  477. if (nr == 0) {
  478. bridge->ops = &pcie_ops;
  479. return pci_scan_root_bus_bridge(bridge);
  480. }
  481. if (nr == 1 && !orion5x_pci_disabled) {
  482. bridge->ops = &pci_ops;
  483. return pci_scan_root_bus_bridge(bridge);
  484. }
  485. BUG();
  486. return -ENODEV;
  487. }
  488. int __init orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  489. {
  490. int bus = dev->bus->number;
  491. /*
  492. * PCIe endpoint?
  493. */
  494. if (orion5x_pci_disabled || bus < orion5x_pci_local_bus_nr())
  495. return IRQ_ORION5X_PCIE0_INT;
  496. return -1;
  497. }