diff options
| author | Kim Phillips <kim.phillips@freescale.com> | 2006-10-02 21:10:30 -0400 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2006-10-04 01:27:49 -0400 |
| commit | 9020fc960b8f5fbca0de6e4d11881ddc827aa61d (patch) | |
| tree | f8ebaf9057a93a3f3d6d6af2e5aa73b695ddce65 | |
| parent | 6c4a2501d0b9fe90882efea5541275a46cda2a1a (diff) | |
[POWERPC] Add support for the mpc832x mds board
Add support for MPC832x MDS evaluation board.
This patch depends on the 8360+QE lib patches by Leo.
The MPC832x processors (MPC8323E, MPC8323, MPC8321E, MPC8321) sport
the e300c2 core plus a QUICC Engine (QE). This patch adds support for
the 832x MDS evaluation board.
The 832x MDS dts and defconfig files are pending more tests.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
| -rw-r--r-- | arch/powerpc/platforms/83xx/Kconfig | 13 | ||||
| -rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_mds.c | 215 | ||||
| -rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_mds.h | 19 |
3 files changed, 247 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig index 5fe7b7faf45f..0975e94ac7c4 100644 --- a/arch/powerpc/platforms/83xx/Kconfig +++ b/arch/powerpc/platforms/83xx/Kconfig | |||
| @@ -5,6 +5,13 @@ choice | |||
| 5 | prompt "Machine Type" | 5 | prompt "Machine Type" |
| 6 | default MPC834x_SYS | 6 | default MPC834x_SYS |
| 7 | 7 | ||
| 8 | config MPC832x_MDS | ||
| 9 | bool "Freescale MPC832x MDS" | ||
| 10 | select DEFAULT_UIMAGE | ||
| 11 | select QUICC_ENGINE | ||
| 12 | help | ||
| 13 | This option enables support for the MPC832x MDS evaluation board. | ||
| 14 | |||
| 8 | config MPC834x_SYS | 15 | config MPC834x_SYS |
| 9 | bool "Freescale MPC834x SYS" | 16 | bool "Freescale MPC834x SYS" |
| 10 | select DEFAULT_UIMAGE | 17 | select DEFAULT_UIMAGE |
| @@ -27,6 +34,12 @@ config MPC834x_ITX | |||
| 27 | 34 | ||
| 28 | endchoice | 35 | endchoice |
| 29 | 36 | ||
| 37 | config PPC_MPC832x | ||
| 38 | bool | ||
| 39 | select PPC_UDBG_16550 | ||
| 40 | select PPC_INDIRECT_PCI | ||
| 41 | default y if MPC832x_MDS | ||
| 42 | |||
| 30 | config MPC834x | 43 | config MPC834x |
| 31 | bool | 44 | bool |
| 32 | select PPC_UDBG_16550 | 45 | select PPC_UDBG_16550 |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c new file mode 100644 index 000000000000..54dea9d42dc9 --- /dev/null +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
| @@ -0,0 +1,215 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. | ||
| 3 | * | ||
| 4 | * Description: | ||
| 5 | * MPC832xE MDS board specific routines. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/stddef.h> | ||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/init.h> | ||
| 16 | #include <linux/errno.h> | ||
| 17 | #include <linux/reboot.h> | ||
| 18 | #include <linux/pci.h> | ||
| 19 | #include <linux/kdev_t.h> | ||
| 20 | #include <linux/major.h> | ||
| 21 | #include <linux/console.h> | ||
| 22 | #include <linux/delay.h> | ||
| 23 | #include <linux/seq_file.h> | ||
| 24 | #include <linux/root_dev.h> | ||
| 25 | #include <linux/initrd.h> | ||
| 26 | |||
| 27 | #include <asm/system.h> | ||
| 28 | #include <asm/atomic.h> | ||
| 29 | #include <asm/time.h> | ||
| 30 | #include <asm/io.h> | ||
| 31 | #include <asm/machdep.h> | ||
| 32 | #include <asm/ipic.h> | ||
| 33 | #include <asm/bootinfo.h> | ||
| 34 | #include <asm/irq.h> | ||
| 35 | #include <asm/prom.h> | ||
| 36 | #include <asm/udbg.h> | ||
| 37 | #include <sysdev/fsl_soc.h> | ||
| 38 | #include <asm/qe.h> | ||
| 39 | #include <asm/qe_ic.h> | ||
| 40 | |||
| 41 | #include "mpc83xx.h" | ||
| 42 | #include "mpc832x_mds.h" | ||
| 43 | |||
| 44 | #undef DEBUG | ||
| 45 | #ifdef DEBUG | ||
| 46 | #define DBG(fmt...) udbg_printf(fmt) | ||
| 47 | #else | ||
| 48 | #define DBG(fmt...) | ||
| 49 | #endif | ||
| 50 | |||
| 51 | #ifndef CONFIG_PCI | ||
| 52 | unsigned long isa_io_base = 0; | ||
| 53 | unsigned long isa_mem_base = 0; | ||
| 54 | #endif | ||
| 55 | |||
| 56 | static u8 *bcsr_regs = NULL; | ||
| 57 | |||
| 58 | u8 *get_bcsr(void) | ||
| 59 | { | ||
| 60 | return bcsr_regs; | ||
| 61 | } | ||
| 62 | |||
| 63 | /* ************************************************************************ | ||
| 64 | * | ||
| 65 | * Setup the architecture | ||
| 66 | * | ||
| 67 | */ | ||
| 68 | static void __init mpc832x_sys_setup_arch(void) | ||
| 69 | { | ||
| 70 | struct device_node *np; | ||
| 71 | |||
| 72 | if (ppc_md.progress) | ||
| 73 | ppc_md.progress("mpc832x_sys_setup_arch()", 0); | ||
| 74 | |||
| 75 | np = of_find_node_by_type(NULL, "cpu"); | ||
| 76 | if (np != 0) { | ||
| 77 | unsigned int *fp = | ||
| 78 | (int *)get_property(np, "clock-frequency", NULL); | ||
| 79 | if (fp != 0) | ||
| 80 | loops_per_jiffy = *fp / HZ; | ||
| 81 | else | ||
| 82 | loops_per_jiffy = 50000000 / HZ; | ||
| 83 | of_node_put(np); | ||
| 84 | } | ||
| 85 | |||
| 86 | /* Map BCSR area */ | ||
| 87 | np = of_find_node_by_name(NULL, "bcsr"); | ||
| 88 | if (np != 0) { | ||
| 89 | struct resource res; | ||
| 90 | |||
| 91 | of_address_to_resource(np, 0, &res); | ||
| 92 | bcsr_regs = ioremap(res.start, res.end - res.start +1); | ||
| 93 | of_node_put(np); | ||
| 94 | } | ||
| 95 | |||
| 96 | #ifdef CONFIG_PCI | ||
| 97 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) | ||
| 98 | add_bridge(np); | ||
| 99 | |||
| 100 | ppc_md.pci_swizzle = common_swizzle; | ||
| 101 | ppc_md.pci_exclude_device = mpc83xx_exclude_device; | ||
| 102 | #endif | ||
| 103 | |||
| 104 | #ifdef CONFIG_QUICC_ENGINE | ||
| 105 | qe_reset(); | ||
| 106 | |||
| 107 | if ((np = of_find_node_by_name(np, "par_io")) != NULL) { | ||
| 108 | par_io_init(np); | ||
| 109 | of_node_put(np); | ||
| 110 | |||
| 111 | for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;) | ||
| 112 | par_io_of_config(np); | ||
| 113 | } | ||
| 114 | |||
| 115 | if ((np = of_find_compatible_node(NULL, "network", "ucc_geth")) | ||
| 116 | != NULL){ | ||
| 117 | /* Reset the Ethernet PHY */ | ||
| 118 | bcsr_regs[9] &= ~0x20; | ||
| 119 | udelay(1000); | ||
| 120 | bcsr_regs[9] |= 0x20; | ||
| 121 | iounmap(bcsr_regs); | ||
| 122 | of_node_put(np); | ||
| 123 | } | ||
| 124 | |||
| 125 | #endif /* CONFIG_QUICC_ENGINE */ | ||
| 126 | |||
| 127 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 128 | if (initrd_start) | ||
| 129 | ROOT_DEV = Root_RAM0; | ||
| 130 | else | ||
| 131 | #endif | ||
| 132 | #ifdef CONFIG_ROOT_NFS | ||
| 133 | ROOT_DEV = Root_NFS; | ||
| 134 | #else | ||
| 135 | ROOT_DEV = Root_HDA1; | ||
| 136 | #endif | ||
| 137 | } | ||
| 138 | |||
| 139 | void __init mpc832x_sys_init_IRQ(void) | ||
| 140 | { | ||
| 141 | |||
| 142 | struct device_node *np; | ||
| 143 | |||
| 144 | np = of_find_node_by_type(NULL, "ipic"); | ||
| 145 | if (!np) | ||
| 146 | return; | ||
| 147 | |||
| 148 | ipic_init(np, 0); | ||
| 149 | |||
| 150 | /* Initialize the default interrupt mapping priorities, | ||
| 151 | * in case the boot rom changed something on us. | ||
| 152 | */ | ||
| 153 | ipic_set_default_priority(); | ||
| 154 | of_node_put(np); | ||
| 155 | |||
| 156 | #ifdef CONFIG_QUICC_ENGINE | ||
| 157 | np = of_find_node_by_type(NULL, "qeic"); | ||
| 158 | if (!np) | ||
| 159 | return; | ||
| 160 | |||
| 161 | qe_ic_init(np, 0); | ||
| 162 | of_node_put(np); | ||
| 163 | #endif /* CONFIG_QUICC_ENGINE */ | ||
| 164 | } | ||
| 165 | |||
| 166 | #if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374) | ||
| 167 | extern ulong ds1374_get_rtc_time(void); | ||
| 168 | extern int ds1374_set_rtc_time(ulong); | ||
| 169 | |||
| 170 | static int __init mpc832x_rtc_hookup(void) | ||
| 171 | { | ||
| 172 | struct timespec tv; | ||
| 173 | |||
| 174 | ppc_md.get_rtc_time = ds1374_get_rtc_time; | ||
| 175 | ppc_md.set_rtc_time = ds1374_set_rtc_time; | ||
| 176 | |||
| 177 | tv.tv_nsec = 0; | ||
| 178 | tv.tv_sec = (ppc_md.get_rtc_time) (); | ||
| 179 | do_settimeofday(&tv); | ||
| 180 | |||
| 181 | return 0; | ||
| 182 | } | ||
| 183 | |||
| 184 | late_initcall(mpc832x_rtc_hookup); | ||
| 185 | #endif | ||
| 186 | |||
| 187 | /* | ||
| 188 | * Called very early, MMU is off, device-tree isn't unflattened | ||
| 189 | */ | ||
| 190 | static int __init mpc832x_sys_probe(void) | ||
| 191 | { | ||
| 192 | char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), | ||
| 193 | "model", NULL); | ||
| 194 | |||
| 195 | if (model == NULL) | ||
| 196 | return 0; | ||
| 197 | if (strcmp(model, "MPC8323EMDS")) | ||
| 198 | return 0; | ||
| 199 | |||
| 200 | DBG("%s found\n", model); | ||
| 201 | |||
| 202 | return 1; | ||
| 203 | } | ||
| 204 | |||
| 205 | define_machine(mpc832x_mds) { | ||
| 206 | .name = "MPC832x MDS", | ||
| 207 | .probe = mpc832x_sys_probe, | ||
| 208 | .setup_arch = mpc832x_sys_setup_arch, | ||
| 209 | .init_IRQ = mpc832x_sys_init_IRQ, | ||
| 210 | .get_irq = ipic_get_irq, | ||
| 211 | .restart = mpc83xx_restart, | ||
| 212 | .time_init = mpc83xx_time_init, | ||
| 213 | .calibrate_decr = generic_calibrate_decr, | ||
| 214 | .progress = udbg_progress, | ||
| 215 | }; | ||
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.h b/arch/powerpc/platforms/83xx/mpc832x_mds.h new file mode 100644 index 000000000000..a49588904f8a --- /dev/null +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. | ||
| 3 | * | ||
| 4 | * Description: | ||
| 5 | * MPC832x MDS board specific header. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_MPC832x_MDS_H__ | ||
| 15 | #define __MACH_MPC832x_MDS_H__ | ||
| 16 | |||
| 17 | extern u8 *get_bcsr(void); | ||
| 18 | |||
| 19 | #endif /* __MACH_MPC832x_MDS_H__ */ | ||
