diff options
| -rw-r--r-- | arch/powerpc/platforms/85xx/Kconfig | 10 | ||||
| -rw-r--r-- | arch/powerpc/platforms/85xx/Makefile | 1 | ||||
| -rw-r--r-- | arch/powerpc/platforms/85xx/sbc8548.c | 169 |
3 files changed, 178 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig index 333779ee5f1e..74779b92ff36 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig | |||
| @@ -83,6 +83,12 @@ config TQM8560 | |||
| 83 | select TQM85xx | 83 | select TQM85xx |
| 84 | select CPM2 | 84 | select CPM2 |
| 85 | 85 | ||
| 86 | config SBC8548 | ||
| 87 | bool "Wind River SBC8548" | ||
| 88 | select DEFAULT_UIMAGE | ||
| 89 | help | ||
| 90 | This option enables support for the Wind River SBC8548 board | ||
| 91 | |||
| 86 | config SBC8560 | 92 | config SBC8560 |
| 87 | bool "Wind River SBC8560" | 93 | bool "Wind River SBC8560" |
| 88 | select DEFAULT_UIMAGE | 94 | select DEFAULT_UIMAGE |
| @@ -100,7 +106,7 @@ config MPC8540 | |||
| 100 | bool | 106 | bool |
| 101 | select PPC_UDBG_16550 | 107 | select PPC_UDBG_16550 |
| 102 | select PPC_INDIRECT_PCI | 108 | select PPC_INDIRECT_PCI |
| 103 | default y if MPC8540_ADS || MPC85xx_CDS | 109 | default y if MPC8540_ADS || MPC85xx_CDS || SBC8548 |
| 104 | 110 | ||
| 105 | config MPC85xx | 111 | config MPC85xx |
| 106 | bool | 112 | bool |
| @@ -110,4 +116,4 @@ config MPC85xx | |||
| 110 | select FSL_PCI if PCI | 116 | select FSL_PCI if PCI |
| 111 | select SERIAL_8250_SHARE_IRQ if SERIAL_8250 | 117 | select SERIAL_8250_SHARE_IRQ if SERIAL_8250 |
| 112 | default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ | 118 | default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ |
| 113 | || MPC85xx_MDS || MPC85xx_DS || STX_GP3 || SBC8560 | 119 | || MPC85xx_MDS || MPC85xx_DS || STX_GP3 || SBC8560 || SBC8548 |
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index 698f9f950504..cb7af4ebd75f 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
| @@ -9,3 +9,4 @@ obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o | |||
| 9 | obj-$(CONFIG_STX_GP3) += stx_gp3.o | 9 | obj-$(CONFIG_STX_GP3) += stx_gp3.o |
| 10 | obj-$(CONFIG_TQM85xx) += tqm85xx.o | 10 | obj-$(CONFIG_TQM85xx) += tqm85xx.o |
| 11 | obj-$(CONFIG_SBC8560) += sbc8560.o | 11 | obj-$(CONFIG_SBC8560) += sbc8560.o |
| 12 | obj-$(CONFIG_SBC8548) += sbc8548.o | ||
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c new file mode 100644 index 000000000000..de27b576c13d --- /dev/null +++ b/arch/powerpc/platforms/85xx/sbc8548.c | |||
| @@ -0,0 +1,169 @@ | |||
| 1 | /* | ||
| 2 | * Wind River SBC8548 setup and early boot code. | ||
| 3 | * | ||
| 4 | * Copyright 2007 Wind River Systems Inc. | ||
| 5 | * | ||
| 6 | * By Paul Gortmaker (see MAINTAINERS for contact information) | ||
| 7 | * | ||
| 8 | * Based largely on the MPC8548CDS support - Copyright 2005 Freescale Inc. | ||
| 9 | * | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify it | ||
| 12 | * under the terms of the GNU General Public License as published by the | ||
| 13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 14 | * option) any later version. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include <linux/stddef.h> | ||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/errno.h> | ||
| 21 | #include <linux/reboot.h> | ||
| 22 | #include <linux/pci.h> | ||
| 23 | #include <linux/kdev_t.h> | ||
| 24 | #include <linux/major.h> | ||
| 25 | #include <linux/console.h> | ||
| 26 | #include <linux/delay.h> | ||
| 27 | #include <linux/seq_file.h> | ||
| 28 | #include <linux/initrd.h> | ||
| 29 | #include <linux/module.h> | ||
| 30 | #include <linux/interrupt.h> | ||
| 31 | #include <linux/fsl_devices.h> | ||
| 32 | #include <linux/of_platform.h> | ||
| 33 | |||
| 34 | #include <asm/system.h> | ||
| 35 | #include <asm/pgtable.h> | ||
| 36 | #include <asm/page.h> | ||
| 37 | #include <asm/atomic.h> | ||
| 38 | #include <asm/time.h> | ||
| 39 | #include <asm/io.h> | ||
| 40 | #include <asm/machdep.h> | ||
| 41 | #include <asm/ipic.h> | ||
| 42 | #include <asm/pci-bridge.h> | ||
| 43 | #include <asm/irq.h> | ||
| 44 | #include <mm/mmu_decl.h> | ||
| 45 | #include <asm/prom.h> | ||
| 46 | #include <asm/udbg.h> | ||
| 47 | #include <asm/mpic.h> | ||
| 48 | |||
| 49 | #include <sysdev/fsl_soc.h> | ||
| 50 | #include <sysdev/fsl_pci.h> | ||
| 51 | |||
| 52 | static void __init sbc8548_pic_init(void) | ||
| 53 | { | ||
| 54 | struct mpic *mpic; | ||
| 55 | struct resource r; | ||
| 56 | struct device_node *np = NULL; | ||
| 57 | |||
| 58 | np = of_find_node_by_type(np, "open-pic"); | ||
| 59 | |||
| 60 | if (np == NULL) { | ||
| 61 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
| 62 | return; | ||
| 63 | } | ||
| 64 | |||
| 65 | if (of_address_to_resource(np, 0, &r)) { | ||
| 66 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
| 67 | of_node_put(np); | ||
| 68 | return; | ||
| 69 | } | ||
| 70 | |||
| 71 | mpic = mpic_alloc(np, r.start, | ||
| 72 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
| 73 | 0, 256, " OpenPIC "); | ||
| 74 | BUG_ON(mpic == NULL); | ||
| 75 | |||
| 76 | /* Return the mpic node */ | ||
| 77 | of_node_put(np); | ||
| 78 | |||
| 79 | mpic_init(mpic); | ||
| 80 | } | ||
| 81 | |||
| 82 | /* | ||
| 83 | * Setup the architecture | ||
| 84 | */ | ||
| 85 | static void __init sbc8548_setup_arch(void) | ||
| 86 | { | ||
| 87 | #ifdef CONFIG_PCI | ||
| 88 | struct device_node *np; | ||
| 89 | #endif | ||
| 90 | |||
| 91 | if (ppc_md.progress) | ||
| 92 | ppc_md.progress("sbc8548_setup_arch()", 0); | ||
| 93 | |||
| 94 | #ifdef CONFIG_PCI | ||
| 95 | for_each_node_by_type(np, "pci") { | ||
| 96 | if (of_device_is_compatible(np, "fsl,mpc8540-pci") || | ||
| 97 | of_device_is_compatible(np, "fsl,mpc8548-pcie")) { | ||
| 98 | struct resource rsrc; | ||
| 99 | of_address_to_resource(np, 0, &rsrc); | ||
| 100 | if ((rsrc.start & 0xfffff) == 0x8000) | ||
| 101 | fsl_add_bridge(np, 1); | ||
| 102 | else | ||
| 103 | fsl_add_bridge(np, 0); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | #endif | ||
| 107 | } | ||
| 108 | |||
| 109 | static void sbc8548_show_cpuinfo(struct seq_file *m) | ||
| 110 | { | ||
| 111 | uint pvid, svid, phid1; | ||
| 112 | uint memsize = total_memory; | ||
| 113 | |||
| 114 | pvid = mfspr(SPRN_PVR); | ||
| 115 | svid = mfspr(SPRN_SVR); | ||
| 116 | |||
| 117 | seq_printf(m, "Vendor\t\t: Wind River\n"); | ||
| 118 | seq_printf(m, "Machine\t\t: SBC8548\n"); | ||
| 119 | seq_printf(m, "PVR\t\t: 0x%x\n", pvid); | ||
| 120 | seq_printf(m, "SVR\t\t: 0x%x\n", svid); | ||
| 121 | |||
| 122 | /* Display cpu Pll setting */ | ||
| 123 | phid1 = mfspr(SPRN_HID1); | ||
| 124 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); | ||
| 125 | |||
| 126 | /* Display the amount of memory */ | ||
| 127 | seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024)); | ||
| 128 | } | ||
| 129 | |||
| 130 | static struct of_device_id __initdata of_bus_ids[] = { | ||
| 131 | { .name = "soc", }, | ||
| 132 | { .type = "soc", }, | ||
| 133 | {}, | ||
| 134 | }; | ||
| 135 | |||
| 136 | static int __init declare_of_platform_devices(void) | ||
| 137 | { | ||
| 138 | if (!machine_is(sbc8548)) | ||
| 139 | return 0; | ||
| 140 | |||
| 141 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
| 142 | return 0; | ||
| 143 | } | ||
| 144 | device_initcall(declare_of_platform_devices); | ||
| 145 | |||
| 146 | /* | ||
| 147 | * Called very early, device-tree isn't unflattened | ||
| 148 | */ | ||
| 149 | static int __init sbc8548_probe(void) | ||
| 150 | { | ||
| 151 | unsigned long root = of_get_flat_dt_root(); | ||
| 152 | |||
| 153 | return of_flat_dt_is_compatible(root, "SBC8548"); | ||
| 154 | } | ||
| 155 | |||
| 156 | define_machine(sbc8548) { | ||
| 157 | .name = "SBC8548", | ||
| 158 | .probe = sbc8548_probe, | ||
| 159 | .setup_arch = sbc8548_setup_arch, | ||
| 160 | .init_IRQ = sbc8548_pic_init, | ||
| 161 | .show_cpuinfo = sbc8548_show_cpuinfo, | ||
| 162 | .get_irq = mpic_get_irq, | ||
| 163 | .restart = fsl_rstcr_restart, | ||
| 164 | #ifdef CONFIG_PCI | ||
| 165 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
| 166 | #endif | ||
| 167 | .calibrate_decr = generic_calibrate_decr, | ||
| 168 | .progress = udbg_progress, | ||
| 169 | }; | ||
