beagle.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * (C) Copyright 2004-2011
  3. * Texas Instruments, <www.ti.com>
  4. *
  5. * Author :
  6. * Sunil Kumar <sunilsaini05@gmail.com>
  7. * Shashi Ranjan <shashiranjanmca05@gmail.com>
  8. *
  9. * Derived from Beagle Board and 3430 SDP code by
  10. * Richard Woodruff <r-woodruff2@ti.com>
  11. * Syed Mohammed Khasim <khasim@ti.com>
  12. *
  13. *
  14. * See file CREDITS for list of people who contributed to this
  15. * project.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  30. * MA 02111-1307 USA
  31. */
  32. #include <common.h>
  33. #ifdef CONFIG_STATUS_LED
  34. #include <status_led.h>
  35. #endif
  36. #include <twl4030.h>
  37. #include <linux/mtd/nand.h>
  38. #include <asm/io.h>
  39. #include <asm/arch/mmc_host_def.h>
  40. #include <asm/arch/mux.h>
  41. #include <asm/arch/mem.h>
  42. #include <asm/arch/sys_proto.h>
  43. #include <asm/gpio.h>
  44. #include <asm/mach-types.h>
  45. #include "beagle.h"
  46. #include <command.h>
  47. #ifdef CONFIG_USB_EHCI
  48. #include <usb.h>
  49. #include <asm/ehci-omap.h>
  50. #endif
  51. #define pr_debug(fmt, args...) debug(fmt, ##args)
  52. #define TWL4030_I2C_BUS 0
  53. #define EXPANSION_EEPROM_I2C_BUS 1
  54. #define EXPANSION_EEPROM_I2C_ADDRESS 0x50
  55. #define TINCANTOOLS_ZIPPY 0x01000100
  56. #define TINCANTOOLS_ZIPPY2 0x02000100
  57. #define TINCANTOOLS_TRAINER 0x04000100
  58. #define TINCANTOOLS_SHOWDOG 0x03000100
  59. #define KBADC_BEAGLEFPGA 0x01000600
  60. #define LW_BEAGLETOUCH 0x01000700
  61. #define BRAINMUX_LCDOG 0x01000800
  62. #define BRAINMUX_LCDOGTOUCH 0x02000800
  63. #define BBTOYS_WIFI 0x01000B00
  64. #define BBTOYS_VGA 0x02000B00
  65. #define BBTOYS_LCD 0x03000B00
  66. #define BCT_BRETTL3 0x01000F00
  67. #define BEAGLE_NO_EEPROM 0xffffffff
  68. DECLARE_GLOBAL_DATA_PTR;
  69. static struct {
  70. unsigned int device_vendor;
  71. unsigned char revision;
  72. unsigned char content;
  73. char fab_revision[8];
  74. char env_var[16];
  75. char env_setting[64];
  76. } expansion_config;
  77. /*
  78. * Routine: board_init
  79. * Description: Early hardware init.
  80. */
  81. int board_init(void)
  82. {
  83. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  84. /* board id for Linux */
  85. gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
  86. /* boot param addr */
  87. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  88. #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
  89. status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
  90. #endif
  91. return 0;
  92. }
  93. /*
  94. * Routine: get_board_revision
  95. * Description: Detect if we are running on a Beagle revision Ax/Bx,
  96. * C1/2/3, C4 or xM. This can be done by reading
  97. * the level of GPIO173, GPIO172 and GPIO171. This should
  98. * result in
  99. * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx
  100. * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3
  101. * GPIO173, GPIO172, GPIO171: 1 0 1 => C4
  102. * GPIO173, GPIO172, GPIO171: 0 0 0 => xM
  103. */
  104. int get_board_revision(void)
  105. {
  106. int revision;
  107. if (!gpio_request(171, "") &&
  108. !gpio_request(172, "") &&
  109. !gpio_request(173, "")) {
  110. gpio_direction_input(171);
  111. gpio_direction_input(172);
  112. gpio_direction_input(173);
  113. revision = gpio_get_value(173) << 2 |
  114. gpio_get_value(172) << 1 |
  115. gpio_get_value(171);
  116. } else {
  117. printf("Error: unable to acquire board revision GPIOs\n");
  118. revision = -1;
  119. }
  120. return revision;
  121. }
  122. #ifdef CONFIG_SPL_BUILD
  123. /*
  124. * Routine: get_board_mem_timings
  125. * Description: If we use SPL then there is no x-loader nor config header
  126. * so we have to setup the DDR timings ourself on both banks.
  127. */
  128. void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
  129. u32 *mr)
  130. {
  131. int pop_mfr, pop_id;
  132. /*
  133. * We need to identify what PoP memory is on the board so that
  134. * we know what timings to use. If we can't identify it then
  135. * we know it's an xM. To map the ID values please see nand_ids.c
  136. */
  137. identify_nand_chip(&pop_mfr, &pop_id);
  138. *mr = MICRON_V_MR_165;
  139. switch (get_board_revision()) {
  140. case REVISION_C4:
  141. if (pop_mfr == NAND_MFR_STMICRO && pop_id == 0xba) {
  142. /* 512MB DDR */
  143. *mcfg = NUMONYX_V_MCFG_165(512 << 20);
  144. *ctrla = NUMONYX_V_ACTIMA_165;
  145. *ctrlb = NUMONYX_V_ACTIMB_165;
  146. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  147. break;
  148. } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) {
  149. /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/
  150. *mcfg = MICRON_V_MCFG_165(128 << 20);
  151. *ctrla = MICRON_V_ACTIMA_165;
  152. *ctrlb = MICRON_V_ACTIMB_165;
  153. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  154. break;
  155. } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) {
  156. /* Beagleboard Rev C5, 256MB DDR */
  157. *mcfg = MICRON_V_MCFG_200(256 << 20);
  158. *ctrla = MICRON_V_ACTIMA_200;
  159. *ctrlb = MICRON_V_ACTIMB_200;
  160. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  161. break;
  162. }
  163. case REVISION_XM_A:
  164. case REVISION_XM_B:
  165. case REVISION_XM_C:
  166. if (pop_mfr == 0) {
  167. /* 256MB DDR */
  168. *mcfg = MICRON_V_MCFG_200(256 << 20);
  169. *ctrla = MICRON_V_ACTIMA_200;
  170. *ctrlb = MICRON_V_ACTIMB_200;
  171. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  172. } else {
  173. /* 512MB DDR */
  174. *mcfg = NUMONYX_V_MCFG_165(512 << 20);
  175. *ctrla = NUMONYX_V_ACTIMA_165;
  176. *ctrlb = NUMONYX_V_ACTIMB_165;
  177. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  178. }
  179. break;
  180. default:
  181. /* Assume 128MB and Micron/165MHz timings to be safe */
  182. *mcfg = MICRON_V_MCFG_165(128 << 20);
  183. *ctrla = MICRON_V_ACTIMA_165;
  184. *ctrlb = MICRON_V_ACTIMB_165;
  185. *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  186. }
  187. }
  188. #endif
  189. /*
  190. * Routine: get_expansion_id
  191. * Description: This function checks for expansion board by checking I2C
  192. * bus 1 for the availability of an AT24C01B serial EEPROM.
  193. * returns the device_vendor field from the EEPROM
  194. */
  195. unsigned int get_expansion_id(void)
  196. {
  197. i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
  198. /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
  199. if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
  200. i2c_set_bus_num(TWL4030_I2C_BUS);
  201. return BEAGLE_NO_EEPROM;
  202. }
  203. /* read configuration data */
  204. i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
  205. sizeof(expansion_config));
  206. i2c_set_bus_num(TWL4030_I2C_BUS);
  207. return expansion_config.device_vendor;
  208. }
  209. /*
  210. * Configure DSS to display background color on DVID
  211. * Configure VENC to display color bar on S-Video
  212. */
  213. void beagle_display_init(void)
  214. {
  215. omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
  216. switch (get_board_revision()) {
  217. case REVISION_AXBX:
  218. case REVISION_CX:
  219. case REVISION_C4:
  220. omap3_dss_panel_config(&dvid_cfg);
  221. break;
  222. case REVISION_XM_A:
  223. case REVISION_XM_B:
  224. case REVISION_XM_C:
  225. default:
  226. omap3_dss_panel_config(&dvid_cfg_xm);
  227. break;
  228. }
  229. }
  230. /*
  231. * Enable DVI power
  232. */
  233. static void beagle_dvi_pup() {
  234. uchar val;
  235. switch (get_board_revision()) {
  236. case REVISION_AXBX:
  237. case REVISION_CX:
  238. case REVISION_C4:
  239. case REVISION_XM_A:
  240. gpio_request(170, "");
  241. gpio_direction_output(170, 0);
  242. gpio_set_value(170, 1);
  243. break;
  244. case REVISION_XM_B:
  245. case REVISION_XM_C:
  246. default:
  247. #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
  248. #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
  249. i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
  250. val |= 4;
  251. i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
  252. i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
  253. val |= 4;
  254. i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
  255. break;
  256. }
  257. }
  258. /*
  259. * Routine: misc_init_r
  260. * Description: Configure board specific parts
  261. */
  262. int misc_init_r(void)
  263. {
  264. struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
  265. struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
  266. struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
  267. /* Enable i2c2 pullup resisters */
  268. writel(~(PRG_I2C2_PULLUPRESX), &prog_io_base->io1);
  269. switch (get_board_revision()) {
  270. case REVISION_AXBX:
  271. printf("Beagle Rev Ax/Bx\n");
  272. setenv("beaglerev", "AxBx");
  273. break;
  274. case REVISION_CX:
  275. printf("Beagle Rev C1/C2/C3\n");
  276. setenv("beaglerev", "Cx");
  277. MUX_BEAGLE_C();
  278. break;
  279. case REVISION_C4:
  280. printf("Beagle Rev C4\n");
  281. setenv("beaglerev", "C4");
  282. MUX_BEAGLE_C();
  283. /* Set VAUX2 to 1.8V for EHCI PHY */
  284. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  285. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  286. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  287. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  288. break;
  289. case REVISION_XM_A:
  290. printf("Beagle xM Rev A\n");
  291. setenv("beaglerev", "xMA");
  292. MUX_BEAGLE_XM();
  293. /* Set VAUX2 to 1.8V for EHCI PHY */
  294. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  295. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  296. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  297. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  298. break;
  299. case REVISION_XM_B:
  300. printf("Beagle xM Rev B\n");
  301. setenv("beaglerev", "xMB");
  302. MUX_BEAGLE_XM();
  303. /* Set VAUX2 to 1.8V for EHCI PHY */
  304. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  305. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  306. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  307. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  308. break;
  309. case REVISION_XM_C:
  310. printf("Beagle xM Rev C\n");
  311. setenv("beaglerev", "xMC");
  312. MUX_BEAGLE_XM();
  313. /* Set VAUX2 to 1.8V for EHCI PHY */
  314. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  315. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  316. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  317. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  318. break;
  319. default:
  320. printf("Beagle unknown 0x%02x\n", get_board_revision());
  321. MUX_BEAGLE_XM();
  322. /* Set VAUX2 to 1.8V for EHCI PHY */
  323. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  324. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  325. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  326. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  327. }
  328. switch (get_expansion_id()) {
  329. case TINCANTOOLS_ZIPPY:
  330. printf("Recognized Tincantools Zippy board (rev %d %s)\n",
  331. expansion_config.revision,
  332. expansion_config.fab_revision);
  333. MUX_TINCANTOOLS_ZIPPY();
  334. setenv("buddy", "zippy");
  335. break;
  336. case TINCANTOOLS_ZIPPY2:
  337. printf("Recognized Tincantools Zippy2 board (rev %d %s)\n",
  338. expansion_config.revision,
  339. expansion_config.fab_revision);
  340. MUX_TINCANTOOLS_ZIPPY();
  341. setenv("buddy", "zippy2");
  342. break;
  343. case TINCANTOOLS_TRAINER:
  344. printf("Recognized Tincantools Trainer board (rev %d %s)\n",
  345. expansion_config.revision,
  346. expansion_config.fab_revision);
  347. MUX_TINCANTOOLS_ZIPPY();
  348. MUX_TINCANTOOLS_TRAINER();
  349. setenv("buddy", "trainer");
  350. break;
  351. case TINCANTOOLS_SHOWDOG:
  352. printf("Recognized Tincantools Showdow board (rev %d %s)\n",
  353. expansion_config.revision,
  354. expansion_config.fab_revision);
  355. /* Place holder for DSS2 definition for showdog lcd */
  356. setenv("defaultdisplay", "showdoglcd");
  357. setenv("buddy", "showdog");
  358. break;
  359. case KBADC_BEAGLEFPGA:
  360. printf("Recognized KBADC Beagle FPGA board\n");
  361. MUX_KBADC_BEAGLEFPGA();
  362. setenv("buddy", "beaglefpga");
  363. break;
  364. case LW_BEAGLETOUCH:
  365. printf("Recognized Liquidware BeagleTouch board\n");
  366. setenv("buddy", "beagletouch");
  367. break;
  368. case BRAINMUX_LCDOG:
  369. printf("Recognized Brainmux LCDog board\n");
  370. setenv("buddy", "lcdog");
  371. break;
  372. case BRAINMUX_LCDOGTOUCH:
  373. printf("Recognized Brainmux LCDog Touch board\n");
  374. setenv("buddy", "lcdogtouch");
  375. break;
  376. case BBTOYS_WIFI:
  377. printf("Recognized BeagleBoardToys WiFi board\n");
  378. MUX_BBTOYS_WIFI()
  379. setenv("buddy", "bbtoys-wifi");
  380. break;;
  381. case BBTOYS_VGA:
  382. printf("Recognized BeagleBoardToys VGA board\n");
  383. break;;
  384. case BBTOYS_LCD:
  385. printf("Recognized BeagleBoardToys LCD board\n");
  386. break;;
  387. case BCT_BRETTL3:
  388. printf("Recognized bct electronic GmbH brettl3 board\n");
  389. break;
  390. case BEAGLE_NO_EEPROM:
  391. printf("No EEPROM on expansion board\n");
  392. setenv("buddy", "none");
  393. break;
  394. default:
  395. printf("Unrecognized expansion board: %x\n",
  396. expansion_config.device_vendor);
  397. setenv("buddy", "unknown");
  398. }
  399. if (expansion_config.content == 1)
  400. setenv(expansion_config.env_var, expansion_config.env_setting);
  401. twl4030_power_init();
  402. switch (get_board_revision()) {
  403. case REVISION_XM_A:
  404. case REVISION_XM_B:
  405. twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
  406. break;
  407. default:
  408. twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
  409. break;
  410. }
  411. /* Set GPIO states before they are made outputs */
  412. writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,
  413. &gpio6_base->setdataout);
  414. writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
  415. GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout);
  416. /* Configure GPIOs to output */
  417. writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
  418. writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
  419. GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
  420. dieid_num_r();
  421. beagle_dvi_pup();
  422. beagle_display_init();
  423. omap3_dss_enable();
  424. return 0;
  425. }
  426. /*
  427. * Routine: set_muxconf_regs
  428. * Description: Setting up the configuration Mux registers specific to the
  429. * hardware. Many pins need to be moved from protect to primary
  430. * mode.
  431. */
  432. void set_muxconf_regs(void)
  433. {
  434. MUX_BEAGLE();
  435. }
  436. #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
  437. int board_mmc_init(bd_t *bis)
  438. {
  439. omap_mmc_init(0);
  440. return 0;
  441. }
  442. #endif
  443. #ifdef CONFIG_USB_EHCI
  444. /* Call usb_stop() before starting the kernel */
  445. void show_boot_progress(int val)
  446. {
  447. if (val == BOOTSTAGE_ID_RUN_OS)
  448. usb_stop();
  449. }
  450. static struct omap_usbhs_board_data usbhs_bdata = {
  451. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  452. .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  453. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
  454. };
  455. int ehci_hcd_init(void)
  456. {
  457. return omap_ehci_hcd_init(&usbhs_bdata);
  458. }
  459. int ehci_hcd_stop(void)
  460. {
  461. return omap_ehci_hcd_stop();
  462. }
  463. #endif /* CONFIG_USB_EHCI */
  464. #ifndef CONFIG_SPL_BUILD
  465. /*
  466. * This command returns the status of the user button on beagle xM
  467. * Input - none
  468. * Returns - 1 if button is held down
  469. * 0 if button is not held down
  470. */
  471. int do_userbutton(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  472. {
  473. int button = 0;
  474. int gpio;
  475. /*
  476. * pass address parameter as argv[0] (aka command name),
  477. * and all remaining args
  478. */
  479. switch (get_board_revision()) {
  480. case REVISION_AXBX:
  481. case REVISION_CX:
  482. case REVISION_C4:
  483. gpio = 7;
  484. break;
  485. case REVISION_XM_A:
  486. case REVISION_XM_B:
  487. case REVISION_XM_C:
  488. default:
  489. gpio = 4;
  490. break;
  491. }
  492. gpio_request(gpio, "");
  493. gpio_direction_input(gpio);
  494. printf("The user button is currently ");
  495. if (gpio_get_value(gpio))
  496. {
  497. button = 1;
  498. printf("PRESSED.\n");
  499. }
  500. else
  501. {
  502. button = 0;
  503. printf("NOT pressed.\n");
  504. }
  505. return !button;
  506. }
  507. /* -------------------------------------------------------------------- */
  508. U_BOOT_CMD(
  509. userbutton, CONFIG_SYS_MAXARGS, 1, do_userbutton,
  510. "Return the status of the BeagleBoard USER button",
  511. ""
  512. );
  513. #endif