common: Drop net.h from common header
[platform/kernel/u-boot.git] / board / ti / beagle / beagle.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2004-2011
4  * Texas Instruments, <www.ti.com>
5  *
6  * Author :
7  *      Sunil Kumar <sunilsaini05@gmail.com>
8  *      Shashi Ranjan <shashiranjanmca05@gmail.com>
9  *
10  * Derived from Beagle Board and 3430 SDP code by
11  *      Richard Woodruff <r-woodruff2@ti.com>
12  *      Syed Mohammed Khasim <khasim@ti.com>
13  *
14  */
15 #include <common.h>
16 #include <dm.h>
17 #include <env.h>
18 #include <net.h>
19 #include <ns16550.h>
20 #include <serial.h>
21 #ifdef CONFIG_LED_STATUS
22 #include <status_led.h>
23 #endif
24 #include <twl4030.h>
25 #include <linux/mtd/rawnand.h>
26 #include <asm/io.h>
27 #include <asm/arch/mmc_host_def.h>
28 #include <asm/arch/mux.h>
29 #include <asm/arch/mem.h>
30 #include <asm/arch/sys_proto.h>
31 #include <asm/gpio.h>
32 #include <asm/mach-types.h>
33 #include <asm/omap_musb.h>
34 #include <linux/errno.h>
35 #include <linux/usb/ch9.h>
36 #include <linux/usb/gadget.h>
37 #include <linux/usb/musb.h>
38 #include "beagle.h"
39 #include <command.h>
40
41 #ifdef CONFIG_USB_EHCI_HCD
42 #include <usb.h>
43 #include <asm/ehci-omap.h>
44 #endif
45
46 #define TWL4030_I2C_BUS                 0
47 #define EXPANSION_EEPROM_I2C_BUS        1
48 #define EXPANSION_EEPROM_I2C_ADDRESS    0x50
49
50 #define TINCANTOOLS_ZIPPY               0x01000100
51 #define TINCANTOOLS_ZIPPY2              0x02000100
52 #define TINCANTOOLS_TRAINER             0x04000100
53 #define TINCANTOOLS_SHOWDOG             0x03000100
54 #define KBADC_BEAGLEFPGA                0x01000600
55 #define LW_BEAGLETOUCH                  0x01000700
56 #define BRAINMUX_LCDOG                  0x01000800
57 #define BRAINMUX_LCDOGTOUCH             0x02000800
58 #define BBTOYS_WIFI                     0x01000B00
59 #define BBTOYS_VGA                      0x02000B00
60 #define BBTOYS_LCD                      0x03000B00
61 #define BCT_BRETTL3                     0x01000F00
62 #define BCT_BRETTL4                     0x02000F00
63 #define LSR_COM6L_ADPT                  0x01001300
64 #define BEAGLE_NO_EEPROM                0xffffffff
65
66 DECLARE_GLOBAL_DATA_PTR;
67
68 static struct {
69         unsigned int device_vendor;
70         unsigned char revision;
71         unsigned char content;
72         char fab_revision[8];
73         char env_var[16];
74         char env_setting[64];
75 } expansion_config;
76
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
89 #if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
90         status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
91 #endif
92
93         return 0;
94 }
95
96 #if defined(CONFIG_SPL_OS_BOOT)
97 int spl_start_uboot(void)
98 {
99         /* break into full u-boot on 'c' */
100         if (serial_tstc() && serial_getc() == 'c')
101                 return 1;
102
103         return 0;
104 }
105 #endif /* CONFIG_SPL_OS_BOOT */
106
107 /*
108  * Routine: get_board_revision
109  * Description: Detect if we are running on a Beagle revision Ax/Bx,
110  *              C1/2/3, C4, xM Ax/Bx or xM Cx. This can be done by reading
111  *              the level of GPIO173, GPIO172 and GPIO171. This should
112  *              result in
113  *              GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx
114  *              GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3
115  *              GPIO173, GPIO172, GPIO171: 1 0 1 => C4
116  *              GPIO173, GPIO172, GPIO171: 0 1 0 => xM Cx
117  *              GPIO173, GPIO172, GPIO171: 0 0 0 => xM Ax/Bx
118  */
119 static int get_board_revision(void)
120 {
121         static int revision = -1;
122
123         if (revision == -1) {
124                 if (!gpio_request(171, "rev0") &&
125                     !gpio_request(172, "rev1") &&
126                     !gpio_request(173, "rev2")) {
127                         gpio_direction_input(171);
128                         gpio_direction_input(172);
129                         gpio_direction_input(173);
130
131                         revision = gpio_get_value(173) << 2 |
132                                 gpio_get_value(172) << 1 |
133                                 gpio_get_value(171);
134                 } else {
135                         printf("Error: unable to acquire board revision GPIOs\n");
136                 }
137         }
138
139         return revision;
140 }
141
142 #ifdef CONFIG_SPL_BUILD
143 /*
144  * Routine: get_board_mem_timings
145  * Description: If we use SPL then there is no x-loader nor config header
146  * so we have to setup the DDR timings ourself on both banks.
147  */
148 void get_board_mem_timings(struct board_sdrc_timings *timings)
149 {
150         int pop_mfr, pop_id;
151
152         /*
153          * We need to identify what PoP memory is on the board so that
154          * we know what timings to use.  If we can't identify it then
155          * we know it's an xM.  To map the ID values please see nand_ids.c
156          */
157         identify_nand_chip(&pop_mfr, &pop_id);
158
159         timings->mr = MICRON_V_MR_165;
160         switch (get_board_revision()) {
161         case REVISION_C4:
162                 if (pop_mfr == NAND_MFR_STMICRO && pop_id == 0xba) {
163                         /* 512MB DDR */
164                         timings->mcfg = NUMONYX_V_MCFG_165(512 << 20);
165                         timings->ctrla = NUMONYX_V_ACTIMA_165;
166                         timings->ctrlb = NUMONYX_V_ACTIMB_165;
167                         timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
168                         break;
169                 } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) {
170                         /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/
171                         timings->mcfg = MICRON_V_MCFG_165(128 << 20);
172                         timings->ctrla = MICRON_V_ACTIMA_165;
173                         timings->ctrlb = MICRON_V_ACTIMB_165;
174                         timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
175                         break;
176                 } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) {
177                         /* Beagleboard Rev C5, 256MB DDR */
178                         timings->mcfg = MICRON_V_MCFG_200(256 << 20);
179                         timings->ctrla = MICRON_V_ACTIMA_200;
180                         timings->ctrlb = MICRON_V_ACTIMB_200;
181                         timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
182                         break;
183                 }
184         case REVISION_XM_AB:
185         case REVISION_XM_C:
186                 if (pop_mfr == 0) {
187                         /* 256MB DDR */
188                         timings->mcfg = MICRON_V_MCFG_200(256 << 20);
189                         timings->ctrla = MICRON_V_ACTIMA_200;
190                         timings->ctrlb = MICRON_V_ACTIMB_200;
191                         timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
192                 } else {
193                         /* 512MB DDR */
194                         timings->mcfg = NUMONYX_V_MCFG_165(512 << 20);
195                         timings->ctrla = NUMONYX_V_ACTIMA_165;
196                         timings->ctrlb = NUMONYX_V_ACTIMB_165;
197                         timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
198                 }
199                 break;
200         default:
201                 /* Assume 128MB and Micron/165MHz timings to be safe */
202                 timings->mcfg = MICRON_V_MCFG_165(128 << 20);
203                 timings->ctrla = MICRON_V_ACTIMA_165;
204                 timings->ctrlb = MICRON_V_ACTIMB_165;
205                 timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
206         }
207 }
208 #endif
209
210 /*
211  * Routine: get_expansion_id
212  * Description: This function checks for expansion board by checking I2C
213  *              bus 1 for the availability of an AT24C01B serial EEPROM.
214  *              returns the device_vendor field from the EEPROM
215  */
216 static unsigned int get_expansion_id(void)
217 {
218         i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
219
220         /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
221         if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
222                 i2c_set_bus_num(TWL4030_I2C_BUS);
223                 return BEAGLE_NO_EEPROM;
224         }
225
226         /* read configuration data */
227         i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
228                  sizeof(expansion_config));
229
230         /* retry reading configuration data with 16bit addressing */
231         if ((expansion_config.device_vendor == 0xFFFFFF00) ||
232             (expansion_config.device_vendor == 0xFFFFFFFF)) {
233                 printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
234                 i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
235                          sizeof(expansion_config));
236         }
237
238         i2c_set_bus_num(TWL4030_I2C_BUS);
239
240         return expansion_config.device_vendor;
241 }
242
243 #ifdef CONFIG_VIDEO_OMAP3
244 /*
245  * Configure DSS to display background color on DVID
246  * Configure VENC to display color bar on S-Video
247  */
248 static void beagle_display_init(void)
249 {
250         omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
251         switch (get_board_revision()) {
252         case REVISION_AXBX:
253         case REVISION_CX:
254         case REVISION_C4:
255                 omap3_dss_panel_config(&dvid_cfg);
256                 break;
257         case REVISION_XM_AB:
258         case REVISION_XM_C:
259         default:
260                 omap3_dss_panel_config(&dvid_cfg_xm);
261                 break;
262         }
263 }
264
265 /*
266  * Enable DVI power
267  */
268 static void beagle_dvi_pup(void)
269 {
270         uchar val;
271
272         switch (get_board_revision()) {
273         case REVISION_AXBX:
274         case REVISION_CX:
275         case REVISION_C4:
276                 gpio_request(170, "dvi");
277                 gpio_direction_output(170, 0);
278                 gpio_set_value(170, 1);
279                 break;
280         case REVISION_XM_AB:
281         case REVISION_XM_C:
282         default:
283                 #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
284                 #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
285
286                 i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
287                 val |= 4;
288                 i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
289
290                 i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
291                 val |= 4;
292                 i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
293                 break;
294         }
295 }
296 #endif
297
298 #ifdef CONFIG_USB_MUSB_OMAP2PLUS
299 static struct musb_hdrc_config musb_config = {
300         .multipoint     = 1,
301         .dyn_fifo       = 1,
302         .num_eps        = 16,
303         .ram_bits       = 12,
304 };
305
306 static struct omap_musb_board_data musb_board_data = {
307         .interface_type = MUSB_INTERFACE_ULPI,
308 };
309
310 static struct musb_hdrc_platform_data musb_plat = {
311 #if defined(CONFIG_USB_MUSB_HOST)
312         .mode           = MUSB_HOST,
313 #elif defined(CONFIG_USB_MUSB_GADGET)
314         .mode           = MUSB_PERIPHERAL,
315 #else
316 #error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
317 #endif
318         .config         = &musb_config,
319         .power          = 100,
320         .platform_ops   = &omap2430_ops,
321         .board_data     = &musb_board_data,
322 };
323 #endif
324
325 /*
326  * Routine: misc_init_r
327  * Description: Configure board specific parts
328  */
329 int misc_init_r(void)
330 {
331         struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
332         struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
333         struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
334         bool generate_fake_mac = false;
335         u32 value;
336
337         /* Enable i2c2 pullup resisters */
338         value = readl(&prog_io_base->io1);
339         value &= ~(PRG_I2C2_PULLUPRESX);
340         writel(value, &prog_io_base->io1);
341
342         switch (get_board_revision()) {
343         case REVISION_AXBX:
344                 printf("Beagle Rev Ax/Bx\n");
345                 env_set("beaglerev", "AxBx");
346                 break;
347         case REVISION_CX:
348                 printf("Beagle Rev C1/C2/C3\n");
349                 env_set("beaglerev", "Cx");
350                 MUX_BEAGLE_C();
351                 break;
352         case REVISION_C4:
353                 printf("Beagle Rev C4\n");
354                 env_set("beaglerev", "C4");
355                 MUX_BEAGLE_C();
356                 /* Set VAUX2 to 1.8V for EHCI PHY */
357                 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
358                                         TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
359                                         TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
360                                         TWL4030_PM_RECEIVER_DEV_GRP_P1);
361                 break;
362         case REVISION_XM_AB:
363                 printf("Beagle xM Rev A/B\n");
364                 env_set("beaglerev", "xMAB");
365                 MUX_BEAGLE_XM();
366                 /* Set VAUX2 to 1.8V for EHCI PHY */
367                 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
368                                         TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
369                                         TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
370                                         TWL4030_PM_RECEIVER_DEV_GRP_P1);
371                 generate_fake_mac = true;
372                 break;
373         case REVISION_XM_C:
374                 printf("Beagle xM Rev C\n");
375                 env_set("beaglerev", "xMC");
376                 MUX_BEAGLE_XM();
377                 /* Set VAUX2 to 1.8V for EHCI PHY */
378                 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
379                                         TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
380                                         TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
381                                         TWL4030_PM_RECEIVER_DEV_GRP_P1);
382                 generate_fake_mac = true;
383                 break;
384         default:
385                 printf("Beagle unknown 0x%02x\n", get_board_revision());
386                 MUX_BEAGLE_XM();
387                 /* Set VAUX2 to 1.8V for EHCI PHY */
388                 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
389                                         TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
390                                         TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
391                                         TWL4030_PM_RECEIVER_DEV_GRP_P1);
392                 generate_fake_mac = true;
393         }
394
395         switch (get_expansion_id()) {
396         case TINCANTOOLS_ZIPPY:
397                 printf("Recognized Tincantools Zippy board (rev %d %s)\n",
398                         expansion_config.revision,
399                         expansion_config.fab_revision);
400                 MUX_TINCANTOOLS_ZIPPY();
401                 env_set("buddy", "zippy");
402                 break;
403         case TINCANTOOLS_ZIPPY2:
404                 printf("Recognized Tincantools Zippy2 board (rev %d %s)\n",
405                         expansion_config.revision,
406                         expansion_config.fab_revision);
407                 MUX_TINCANTOOLS_ZIPPY();
408                 env_set("buddy", "zippy2");
409                 break;
410         case TINCANTOOLS_TRAINER:
411                 printf("Recognized Tincantools Trainer board (rev %d %s)\n",
412                         expansion_config.revision,
413                         expansion_config.fab_revision);
414                 MUX_TINCANTOOLS_ZIPPY();
415                 MUX_TINCANTOOLS_TRAINER();
416                 env_set("buddy", "trainer");
417                 break;
418         case TINCANTOOLS_SHOWDOG:
419                 printf("Recognized Tincantools Showdow board (rev %d %s)\n",
420                         expansion_config.revision,
421                         expansion_config.fab_revision);
422                 /* Place holder for DSS2 definition for showdog lcd */
423                 env_set("defaultdisplay", "showdoglcd");
424                 env_set("buddy", "showdog");
425                 break;
426         case KBADC_BEAGLEFPGA:
427                 printf("Recognized KBADC Beagle FPGA board\n");
428                 MUX_KBADC_BEAGLEFPGA();
429                 env_set("buddy", "beaglefpga");
430                 break;
431         case LW_BEAGLETOUCH:
432                 printf("Recognized Liquidware BeagleTouch board\n");
433                 env_set("buddy", "beagletouch");
434                 break;
435         case BRAINMUX_LCDOG:
436                 printf("Recognized Brainmux LCDog board\n");
437                 env_set("buddy", "lcdog");
438                 break;
439         case BRAINMUX_LCDOGTOUCH:
440                 printf("Recognized Brainmux LCDog Touch board\n");
441                 env_set("buddy", "lcdogtouch");
442                 break;
443         case BBTOYS_WIFI:
444                 printf("Recognized BeagleBoardToys WiFi board\n");
445                 MUX_BBTOYS_WIFI()
446                 env_set("buddy", "bbtoys-wifi");
447                 break;
448         case BBTOYS_VGA:
449                 printf("Recognized BeagleBoardToys VGA board\n");
450                 break;
451         case BBTOYS_LCD:
452                 printf("Recognized BeagleBoardToys LCD board\n");
453                 break;
454         case BCT_BRETTL3:
455                 printf("Recognized bct electronic GmbH brettl3 board\n");
456                 break;
457         case BCT_BRETTL4:
458                 printf("Recognized bct electronic GmbH brettl4 board\n");
459                 break;
460         case LSR_COM6L_ADPT:
461                 printf("Recognized LSR COM6L Adapter Board\n");
462                 MUX_BBTOYS_WIFI()
463                 env_set("buddy", "lsr-com6l-adpt");
464                 break;
465         case BEAGLE_NO_EEPROM:
466                 printf("No EEPROM on expansion board\n");
467                 env_set("buddy", "none");
468                 break;
469         default:
470                 printf("Unrecognized expansion board: %x\n",
471                         expansion_config.device_vendor);
472                 env_set("buddy", "unknown");
473         }
474
475         if (expansion_config.content == 1)
476                 env_set(expansion_config.env_var, expansion_config.env_setting);
477
478         twl4030_power_init();
479         switch (get_board_revision()) {
480         case REVISION_XM_AB:
481                 twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
482                 break;
483         default:
484                 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
485                 break;
486         }
487
488         /* Set GPIO states before they are made outputs */
489         writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,
490                 &gpio6_base->setdataout);
491         writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
492                 GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout);
493
494         /* Configure GPIOs to output */
495         writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
496         writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
497                 GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
498
499         omap_die_id_display();
500
501 #ifdef CONFIG_VIDEO_OMAP3
502         beagle_dvi_pup();
503         beagle_display_init();
504         omap3_dss_enable();
505 #endif
506
507 #ifdef CONFIG_USB_MUSB_OMAP2PLUS
508         musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
509 #endif
510
511         if (generate_fake_mac)
512                 omap_die_id_usbethaddr();
513
514 #if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
515         if (strlen(CONFIG_MTDIDS_DEFAULT))
516                 env_set("mtdids", CONFIG_MTDIDS_DEFAULT);
517
518         if (strlen(CONFIG_MTDPARTS_DEFAULT))
519                 env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT);
520 #endif
521
522         return 0;
523 }
524
525 /*
526  * Routine: set_muxconf_regs
527  * Description: Setting up the configuration Mux registers specific to the
528  *              hardware. Many pins need to be moved from protect to primary
529  *              mode.
530  */
531 void set_muxconf_regs(void)
532 {
533         MUX_BEAGLE();
534 }
535
536 #if defined(CONFIG_MMC)
537 int board_mmc_init(bd_t *bis)
538 {
539         return omap_mmc_init(0, 0, 0, -1, -1);
540 }
541 #endif
542
543 #if defined(CONFIG_MMC)
544 void board_mmc_power_init(void)
545 {
546         twl4030_power_mmc_init(0);
547 }
548 #endif
549
550 #if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
551 /* Call usb_stop() before starting the kernel */
552 void show_boot_progress(int val)
553 {
554         if (val == BOOTSTAGE_ID_RUN_OS)
555                 usb_stop();
556 }
557
558 static struct omap_usbhs_board_data usbhs_bdata = {
559         .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
560         .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
561         .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
562 };
563
564 int ehci_hcd_init(int index, enum usb_init_type init,
565                 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
566 {
567         return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
568 }
569
570 int ehci_hcd_stop(int index)
571 {
572         return omap_ehci_hcd_stop();
573 }
574
575 #endif /* CONFIG_USB_EHCI_HCD */
576
577 #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
578 int board_eth_init(bd_t *bis)
579 {
580         return usb_eth_initialize(bis);
581 }
582 #endif