3 * Klaus Heydeck, Kieback & Peter GmbH & Co KG, heydeck@kieback-peter.de
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include "../common/kup.h"
29 #define SL811_ADR (0x50000000)
30 #define SL811_DAT (0x50000001)
33 static void sl811_write_index_data (__u8 index, __u8 data)
35 *(volatile unsigned char *) (SL811_ADR) = index;
37 *(volatile unsigned char *) (SL811_DAT) = data;
41 static __u8 sl811_read_index_data (__u8 index)
45 *(volatile unsigned char *) (SL811_ADR) = index;
47 data = *(volatile unsigned char *) (SL811_DAT);
52 int usb_init_kup4x (void)
54 volatile immap_t *immap = (immap_t *) CFG_IMMR;
55 volatile memctl8xx_t *memctl = &immap->im_memctl;
59 memctl = &immap->im_memctl;
60 memctl->memc_or7 = 0xFFFF8726;
61 memctl->memc_br7 = 0x50000401; /* start at 0x50000000 */
62 /* BP 14 low = USB ON */
63 immap->im_cpm.cp_pbdat &= ~(BP_USB_VCC);
64 /* PB 14 nomal port */
65 immap->im_cpm.cp_pbpar &= ~(BP_USB_VCC);
67 immap->im_cpm.cp_pbdir |= (BP_USB_VCC);
71 for (i = 0x10; i < 0xff; i++) {
72 sl811_write_index_data (i, i);
73 tmp = (sl811_read_index_data (i));
75 printf ("SL811 compare error index=0x%02x read=0x%02x\n", i, tmp);
79 printf ("SL811 ready\n");