3 * Efika 5K2 platform setup
4 * Some code really inspired from the lite5200b platform.
6 * Copyright (C) 2006 bplan GmbH
8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of any
10 * kind, whether express or implied.
14 #include <linux/errno.h>
15 #include <linux/kernel.h>
16 #include <linux/slab.h>
17 #include <linux/reboot.h>
18 #include <linux/init.h>
19 #include <linux/utsrelease.h>
20 #include <linux/seq_file.h>
21 #include <linux/root_dev.h>
22 #include <linux/initrd.h>
23 #include <linux/timer.h>
24 #include <linux/pci.h>
26 #include <asm/pgtable.h>
29 #include <asm/machdep.h>
31 #include <asm/of_device.h>
32 #include <asm/of_platform.h>
33 #include <asm/mpc52xx.h>
37 static void efika_show_cpuinfo(struct seq_file *m)
39 struct device_node *root;
40 const char *revision = NULL;
41 const char *codegendescription = NULL;
42 const char *codegenvendor = NULL;
44 root = of_find_node_by_path("/");
46 revision = get_property(root, "revision", NULL);
48 get_property(root, "CODEGEN,description", NULL);
49 codegenvendor = get_property(root, "CODEGEN,vendor", NULL);
54 if (codegendescription)
55 seq_printf(m, "machine\t\t: %s\n", codegendescription);
57 seq_printf(m, "machine\t\t: Efika\n");
60 seq_printf(m, "revision\t: %s\n", revision);
63 seq_printf(m, "vendor\t\t: %s\n", codegenvendor);
68 static void __init efika_setup_arch(void)
72 #ifdef CONFIG_BLK_DEV_INITRD
73 initrd_below_start_ok = 1;
79 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
84 ppc_md.progress("Linux/PPC " UTS_RELEASE " runnung on Efika ;-)\n", 0x0);
87 static void __init efika_init(void)
89 struct device_node *np;
90 struct device_node *cnp = NULL;
93 /* Find every child of the SOC node and add it to of_platform */
94 np = of_find_node_by_name(NULL, "builtin");
96 char name[BUS_ID_SIZE];
97 while ((cnp = of_get_next_child(np, cnp))) {
98 strcpy(name, cnp->name);
100 base = get_property(cnp, "reg", NULL);
104 snprintf(name+strlen(name), BUS_ID_SIZE, "@%x", *base);
105 of_platform_device_create(cnp, name, NULL);
107 printk(KERN_INFO EFIKA_PLATFORM_NAME" : Added %s (type '%s' at '%s') to the known devices\n", name, cnp->type, cnp->full_name);
112 ppc_md.progress(" Have fun with your Efika! ", 0x7777);
115 static int __init efika_probe(void)
117 char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
122 if (strcmp(model, "EFIKA5K2"))
125 ISA_DMA_THRESHOLD = ~0L;
126 DMA_MODE_READ = 0x44;
127 DMA_MODE_WRITE = 0x48;
132 define_machine(efika)
134 .name = EFIKA_PLATFORM_NAME,
135 .probe = efika_probe,
136 .setup_arch = efika_setup_arch,
138 .show_cpuinfo = efika_show_cpuinfo,
139 .init_IRQ = mpc52xx_init_irq,
140 .get_irq = mpc52xx_get_irq,
141 .restart = rtas_restart,
142 .power_off = rtas_power_off,
144 .set_rtc_time = rtas_set_rtc_time,
145 .get_rtc_time = rtas_get_rtc_time,
146 .progress = rtas_progress,
147 .get_boot_time = rtas_get_boot_time,
148 .calibrate_decr = generic_calibrate_decr,
149 .phys_mem_access_prot = pci_phys_mem_access_prot,