~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/boot/cuboot-hotfoot.c

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Old U-boot compatibility for Esteem 195E Hotfoot CPU Board
  3  *
  4  * Author: Solomon Peachy <solomon@linux-wlan.com>
  5  *
  6  * This program is free software; you can redistribute it and/or modify it
  7  * under the terms of the GNU General Public License version 2 as published
  8  * by the Free Software Foundation.
  9  */
 10 
 11 #include "ops.h"
 12 #include "stdio.h"
 13 #include "reg.h"
 14 #include "dcr.h"
 15 #include "4xx.h"
 16 #include "cuboot.h"
 17 
 18 #define TARGET_4xx
 19 #define TARGET_HOTFOOT
 20 
 21 #include "ppcboot-hotfoot.h"
 22 
 23 static bd_t bd;
 24 
 25 #define NUM_REGS 3
 26 
 27 static void hotfoot_fixups(void)
 28 {
 29         u32 uart = mfdcr(DCRN_CPC0_UCR) & 0x7f;
 30 
 31         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); 
 32 
 33         dt_fixup_cpu_clocks(bd.bi_procfreq, bd.bi_procfreq, 0);
 34         dt_fixup_clock("/plb", bd.bi_plb_busfreq);
 35         dt_fixup_clock("/plb/opb", bd.bi_opbfreq);
 36         dt_fixup_clock("/plb/ebc", bd.bi_pci_busfreq);
 37         dt_fixup_clock("/plb/opb/serial@ef600300", bd.bi_procfreq / uart); 
 38         dt_fixup_clock("/plb/opb/serial@ef600400", bd.bi_procfreq / uart); 
 39         
 40         dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
 41         dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 42 
 43         /* Is this a single eth/serial board? */
 44         if ((bd.bi_enet1addr[0] == 0) && 
 45             (bd.bi_enet1addr[1] == 0) &&
 46             (bd.bi_enet1addr[2] == 0) &&
 47             (bd.bi_enet1addr[3] == 0) &&
 48             (bd.bi_enet1addr[4] == 0) &&
 49             (bd.bi_enet1addr[5] == 0)) {
 50                 void *devp;
 51 
 52                 printf("Trimming devtree for single serial/eth board\n");
 53 
 54                 devp = finddevice("/plb/opb/serial@ef600300");
 55                 if (!devp)
 56                         fatal("Can't find node for /plb/opb/serial@ef600300");
 57                 del_node(devp);
 58 
 59                 devp = finddevice("/plb/opb/ethernet@ef600900");
 60                 if (!devp)
 61                         fatal("Can't find node for /plb/opb/ethernet@ef600900");
 62                 del_node(devp);
 63         }
 64 
 65         ibm4xx_quiesce_eth((u32 *)0xef600800, (u32 *)0xef600900);
 66 
 67         /* Fix up flash size in fdt for 4M boards. */
 68         if (bd.bi_flashsize < 0x800000) {
 69                 u32 regs[NUM_REGS];
 70                 void *devp = finddevice("/plb/ebc/nor_flash@0");
 71                 if (!devp)
 72                         fatal("Can't find FDT node for nor_flash!??");
 73 
 74                 printf("Fixing devtree for 4M Flash\n");
 75                 
 76                 /* First fix up the base addresse */
 77                 getprop(devp, "reg", regs, sizeof(regs));
 78                 regs[0] = 0;
 79                 regs[1] = 0xffc00000;
 80                 regs[2] = 0x00400000;
 81                 setprop(devp, "reg", regs, sizeof(regs));
 82                 
 83                 /* Then the offsets */
 84                 devp = finddevice("/plb/ebc/nor_flash@0/partition@0");
 85                 if (!devp)
 86                         fatal("Can't find FDT node for partition@0");
 87                 getprop(devp, "reg", regs, 2*sizeof(u32));
 88                 regs[0] -= 0x400000;
 89                 setprop(devp, "reg", regs,  2*sizeof(u32));
 90 
 91                 devp = finddevice("/plb/ebc/nor_flash@0/partition@1");
 92                 if (!devp)
 93                         fatal("Can't find FDT node for partition@1");
 94                 getprop(devp, "reg", regs, 2*sizeof(u32));
 95                 regs[0] -= 0x400000;
 96                 setprop(devp, "reg", regs,  2*sizeof(u32));
 97 
 98                 devp = finddevice("/plb/ebc/nor_flash@0/partition@2");
 99                 if (!devp)
100                         fatal("Can't find FDT node for partition@2");
101                 getprop(devp, "reg", regs, 2*sizeof(u32));
102                 regs[0] -= 0x400000;
103                 setprop(devp, "reg", regs,  2*sizeof(u32));
104 
105                 devp = finddevice("/plb/ebc/nor_flash@0/partition@3");
106                 if (!devp)
107                         fatal("Can't find FDT node for partition@3");
108                 getprop(devp, "reg", regs, 2*sizeof(u32));
109                 regs[0] -= 0x400000;
110                 setprop(devp, "reg", regs,  2*sizeof(u32));
111 
112                 devp = finddevice("/plb/ebc/nor_flash@0/partition@4");
113                 if (!devp)
114                         fatal("Can't find FDT node for partition@4");
115                 getprop(devp, "reg", regs, 2*sizeof(u32));
116                 regs[0] -= 0x400000;
117                 setprop(devp, "reg", regs,  2*sizeof(u32));
118 
119                 devp = finddevice("/plb/ebc/nor_flash@0/partition@6");
120                 if (!devp)
121                         fatal("Can't find FDT node for partition@6");
122                 getprop(devp, "reg", regs, 2*sizeof(u32));
123                 regs[0] -= 0x400000;
124                 setprop(devp, "reg", regs,  2*sizeof(u32));
125 
126                 /* Delete the FeatFS node */
127                 devp = finddevice("/plb/ebc/nor_flash@0/partition@5");
128                 if (!devp)
129                         fatal("Can't find FDT node for partition@5");
130                 del_node(devp);
131         }
132 }
133 
134 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
135                    unsigned long r6, unsigned long r7)
136 {
137         CUBOOT_INIT();
138         platform_ops.fixups = hotfoot_fixups;
139         platform_ops.exit = ibm40x_dbcr_reset;
140         fdt_init(_dtb_start);
141         serial_console_init();
142 }
143 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp