3 * Thomas.Lange@corelatus.se
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 <asm/au1x00.h>
27 #include <asm/mipsregs.h>
30 long int initdram(int board_type)
32 /* Sdram is setup by assembler code */
33 /* If memory could be changed, we should return the true value here */
37 #define BCSR_PCMCIA_PC0DRVEN 0x0010
38 #define BCSR_PCMCIA_PC0RST 0x0080
40 /* In cpu/mips/cpu.c */
41 void write_one_tlb( int index, u32 pagemask, u32 hi, u32 low0, u32 low1 );
46 /* volatile u32 *pcmcia_bcsr = (u32*)(DB1000_BCSR_ADDR+0x10); */
47 volatile u32 *sys_counter = (volatile u32*)SYS_COUNTER_CNTRL;
50 *sys_counter = 0x100; /* Enable 32 kHz oscillator for RTC/TOY */
52 proc_id = read_32bit_cp0_register(CP0_PRID);
54 switch (proc_id >> 24) {
56 puts ("Board: Pb1000\n");
57 printf ("CPU: Au1000 396 MHz, id: 0x%02x, rev: 0x%02x\n",
58 (proc_id >> 8) & 0xFF, proc_id & 0xFF);
61 puts ("Board: Pb1500\n");
62 printf ("CPU: Au1500, id: 0x%02x, rev: 0x%02x\n",
63 (proc_id >> 8) & 0xFF, proc_id & 0xFF);
66 puts ("Board: Pb1100\n");
67 printf ("CPU: Au1100, id: 0x%02x, rev: 0x%02x\n",
68 (proc_id >> 8) & 0xFF, proc_id & 0xFF);
71 printf ("Unsupported cpu %d, proc_id=0x%x\n", proc_id >> 24, proc_id);
76 #if defined(CONFIG_IDE_PCMCIA) && 0
77 /* Enable 3.3 V on slot 0 ( VCC )
80 *pcmcia_bcsr = status;
82 status |= BCSR_PCMCIA_PC0DRVEN;
83 *pcmcia_bcsr = status;
88 status |= BCSR_PCMCIA_PC0RST;
89 *pcmcia_bcsr = status;
94 /* PCMCIA is on a 36 bit physical address.
95 We need to map it into a 32 bit addresses */
98 /* We dont need theese unless we run whole pcmcia package */
99 write_one_tlb(20, /* index */
100 0x01ffe000, /* Pagemask, 16 MB pages */
101 CFG_PCMCIA_IO_BASE, /* Hi */
102 0x3C000017, /* Lo0 */
103 0x3C200017); /* Lo1 */
105 write_one_tlb(21, /* index */
106 0x01ffe000, /* Pagemask, 16 MB pages */
107 CFG_PCMCIA_ATTR_BASE, /* Hi */
108 0x3D000017, /* Lo0 */
109 0x3D200017); /* Lo1 */
111 write_one_tlb(22, /* index */
112 0x01ffe000, /* Pagemask, 16 MB pages */
113 CFG_PCMCIA_MEM_ADDR, /* Hi */
114 0x3E000017, /* Lo0 */
115 0x3E200017); /* Lo1 */
116 #endif /* CONFIG_IDE_PCMCIA */