3 * Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.de.
5 * SPDX-License-Identifier: GPL-2.0+
16 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
17 volatile sysconf8xx_t *siu = &immap->im_siu_conf;
19 while (in_be32(&siu->sc_sipend) & 0x20000000) {
20 debug("waiting for 5V VCC\n");
23 /* RS232 / RS485 default is RS232 */
24 clrbits_be16(&immap->im_ioport.iop_padat, PA_RS485);
25 clrbits_be16(&immap->im_ioport.iop_papar, PA_RS485);
26 clrbits_be16(&immap->im_ioport.iop_paodr, PA_RS485);
27 setbits_be16(&immap->im_ioport.iop_padir, PA_RS485);
29 /* IO Reset min 1 msec */
30 setbits_be16(&immap->im_ioport.iop_padat,
31 (PA_RESET_IO_01 | PA_RESET_IO_02));
32 clrbits_be16(&immap->im_ioport.iop_papar,
33 (PA_RESET_IO_01 | PA_RESET_IO_02));
34 clrbits_be16(&immap->im_ioport.iop_paodr,
35 (PA_RESET_IO_01 | PA_RESET_IO_02));
36 setbits_be16(&immap->im_ioport.iop_padir,
37 (PA_RESET_IO_01 | PA_RESET_IO_02));
39 clrbits_be16(&immap->im_ioport.iop_padat,
40 (PA_RESET_IO_01 | PA_RESET_IO_02));
45 void ide_led(uchar led, uchar status)
47 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
49 /* We have one led for both pcmcia slots */
51 clrbits_be16(&immap->im_ioport.iop_padat, PA_LED_YELLOW);
53 setbits_be16(&immap->im_ioport.iop_padat, PA_LED_YELLOW);
57 void poweron_key(void)
59 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
61 clrbits_be16(&immap->im_ioport.iop_pcpar, PC_SWITCH1);
62 clrbits_be16(&immap->im_ioport.iop_pcdir, PC_SWITCH1);
64 if (in_be16(&immap->im_ioport.iop_pcdat) & (PC_SWITCH1))
65 setenv("key1", "off");