Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Add support for OpenBlockS 600

So I've had one of these for a while and it looks like the vendor never
bothered submitting the support upstream.

This adds it using ppc40x_simple and provides a device-tree.

There are some changes to the boot wrapper because the way u-boot works
on this thing, it seems to expect a multipart image with the kernel,
initrd and dtb in it.

The USB support is missing as it needs the yet unmerged driver for
the DWC OTG part and the GPIOs may need further definition in the dts.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+438 -3
+1 -1
arch/powerpc/Makefile
··· 165 165 166 166 # With make 3.82 we cannot mix normal and wildcard targets 167 167 BOOT_TARGETS1 := zImage zImage.initrd uImage 168 - BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% 168 + BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% 169 169 170 170 PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) 171 171
+7
arch/powerpc/boot/Makefile
··· 199 199 image-$(CONFIG_HOTFOOT) += cuImage.hotfoot 200 200 image-$(CONFIG_WALNUT) += treeImage.walnut 201 201 image-$(CONFIG_ACADIA) += cuImage.acadia 202 + image-$(CONFIG_OBS600) += uImage.obs600 202 203 203 204 # Board ports in arch/powerpc/platform/44x/Kconfig 204 205 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony ··· 316 315 317 316 $(obj)/uImage: vmlinux $(wrapperbits) 318 317 $(call if_changed,wrap,uboot) 318 + 319 + $(obj)/uImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) 320 + $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) 321 + 322 + $(obj)/uImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) 323 + $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb) 319 324 320 325 $(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) 321 326 $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+314
arch/powerpc/boot/dts/obs600.dts
··· 1 + /* 2 + * Device Tree Source for PlatHome OpenBlockS 600 (405EX) 3 + * 4 + * Copyright 2011 Ben Herrenschmidt, IBM Corp. 5 + * 6 + * Based on Kilauea by: 7 + * 8 + * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de> 9 + * 10 + * This file is licensed under the terms of the GNU General Public 11 + * License version 2. This program is licensed "as is" without 12 + * any warranty of any kind, whether express or implied. 13 + */ 14 + 15 + /dts-v1/; 16 + 17 + / { 18 + #address-cells = <1>; 19 + #size-cells = <1>; 20 + model = "PlatHome,OpenBlockS 600"; 21 + compatible = "plathome,obs600"; 22 + dcr-parent = <&{/cpus/cpu@0}>; 23 + 24 + aliases { 25 + ethernet0 = &EMAC0; 26 + ethernet1 = &EMAC1; 27 + serial0 = &UART0; 28 + serial1 = &UART1; 29 + }; 30 + 31 + cpus { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + cpu@0 { 36 + device_type = "cpu"; 37 + model = "PowerPC,405EX"; 38 + reg = <0x00000000>; 39 + clock-frequency = <0>; /* Filled in by U-Boot */ 40 + timebase-frequency = <0>; /* Filled in by U-Boot */ 41 + i-cache-line-size = <32>; 42 + d-cache-line-size = <32>; 43 + i-cache-size = <16384>; /* 16 kB */ 44 + d-cache-size = <16384>; /* 16 kB */ 45 + dcr-controller; 46 + dcr-access-method = "native"; 47 + }; 48 + }; 49 + 50 + memory { 51 + device_type = "memory"; 52 + reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */ 53 + }; 54 + 55 + UIC0: interrupt-controller { 56 + compatible = "ibm,uic-405ex", "ibm,uic"; 57 + interrupt-controller; 58 + cell-index = <0>; 59 + dcr-reg = <0x0c0 0x009>; 60 + #address-cells = <0>; 61 + #size-cells = <0>; 62 + #interrupt-cells = <2>; 63 + }; 64 + 65 + UIC1: interrupt-controller1 { 66 + compatible = "ibm,uic-405ex","ibm,uic"; 67 + interrupt-controller; 68 + cell-index = <1>; 69 + dcr-reg = <0x0d0 0x009>; 70 + #address-cells = <0>; 71 + #size-cells = <0>; 72 + #interrupt-cells = <2>; 73 + interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 74 + interrupt-parent = <&UIC0>; 75 + }; 76 + 77 + UIC2: interrupt-controller2 { 78 + compatible = "ibm,uic-405ex","ibm,uic"; 79 + interrupt-controller; 80 + cell-index = <2>; 81 + dcr-reg = <0x0e0 0x009>; 82 + #address-cells = <0>; 83 + #size-cells = <0>; 84 + #interrupt-cells = <2>; 85 + interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */ 86 + interrupt-parent = <&UIC0>; 87 + }; 88 + 89 + CPM0: cpm { 90 + compatible = "ibm,cpm"; 91 + dcr-access-method = "native"; 92 + dcr-reg = <0x0b0 0x003>; 93 + unused-units = <0x00000000>; 94 + idle-doze = <0x02000000>; 95 + standby = <0xe3e74800>; 96 + }; 97 + 98 + plb { 99 + compatible = "ibm,plb-405ex", "ibm,plb4"; 100 + #address-cells = <1>; 101 + #size-cells = <1>; 102 + ranges; 103 + clock-frequency = <0>; /* Filled in by U-Boot */ 104 + 105 + SDRAM0: memory-controller { 106 + compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2"; 107 + dcr-reg = <0x010 0x002>; 108 + interrupt-parent = <&UIC2>; 109 + interrupts = <0x5 0x4 /* ECC DED Error */ 110 + 0x6 0x4>; /* ECC SEC Error */ 111 + }; 112 + 113 + CRYPTO: crypto@ef700000 { 114 + compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto"; 115 + reg = <0xef700000 0x80400>; 116 + interrupt-parent = <&UIC0>; 117 + interrupts = <0x17 0x2>; 118 + }; 119 + 120 + MAL0: mcmal { 121 + compatible = "ibm,mcmal-405ex", "ibm,mcmal2"; 122 + dcr-reg = <0x180 0x062>; 123 + num-tx-chans = <2>; 124 + num-rx-chans = <2>; 125 + interrupt-parent = <&MAL0>; 126 + interrupts = <0x0 0x1 0x2 0x3 0x4>; 127 + #interrupt-cells = <1>; 128 + #address-cells = <0>; 129 + #size-cells = <0>; 130 + interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4 131 + /*RXEOB*/ 0x1 &UIC0 0xb 0x4 132 + /*SERR*/ 0x2 &UIC1 0x0 0x4 133 + /*TXDE*/ 0x3 &UIC1 0x1 0x4 134 + /*RXDE*/ 0x4 &UIC1 0x2 0x4>; 135 + interrupt-map-mask = <0xffffffff>; 136 + }; 137 + 138 + POB0: opb { 139 + compatible = "ibm,opb-405ex", "ibm,opb"; 140 + #address-cells = <1>; 141 + #size-cells = <1>; 142 + ranges = <0x80000000 0x80000000 0x10000000 143 + 0xef600000 0xef600000 0x00a00000 144 + 0xf0000000 0xf0000000 0x10000000>; 145 + dcr-reg = <0x0a0 0x005>; 146 + clock-frequency = <0>; /* Filled in by U-Boot */ 147 + 148 + EBC0: ebc { 149 + compatible = "ibm,ebc-405ex", "ibm,ebc"; 150 + dcr-reg = <0x012 0x002>; 151 + #address-cells = <2>; 152 + #size-cells = <1>; 153 + clock-frequency = <0>; /* Filled in by U-Boot */ 154 + /* ranges property is supplied by U-Boot */ 155 + interrupts = <0x5 0x1>; 156 + interrupt-parent = <&UIC1>; 157 + 158 + nor_flash@0,0 { 159 + compatible = "amd,s29gl512n", "cfi-flash"; 160 + bank-width = <2>; 161 + reg = <0x00000000 0x00000000 0x08000000>; 162 + #address-cells = <1>; 163 + #size-cells = <1>; 164 + partition@0 { 165 + label = "kernel + initrd"; 166 + reg = <0x00000000 0x03de0000>; 167 + }; 168 + partition@3de0000 { 169 + label = "user config area"; 170 + reg = <0x03de0000 0x00080000>; 171 + }; 172 + partition@3e60000 { 173 + label = "user program area"; 174 + reg = <0x03e60000 0x04000000>; 175 + }; 176 + partition@7e60000 { 177 + label = "flat device tree"; 178 + reg = <0x07e60000 0x00080000>; 179 + }; 180 + partition@7ee0000 { 181 + label = "test program"; 182 + reg = <0x07ee0000 0x00080000>; 183 + }; 184 + partition@7f60000 { 185 + label = "u-boot env"; 186 + reg = <0x07f60000 0x00040000>; 187 + }; 188 + partition@7fa0000 { 189 + label = "u-boot"; 190 + reg = <0x07fa0000 0x00060000>; 191 + }; 192 + }; 193 + }; 194 + 195 + UART0: serial@ef600200 { 196 + device_type = "serial"; 197 + compatible = "ns16550"; 198 + reg = <0xef600200 0x00000008>; 199 + virtual-reg = <0xef600200>; 200 + clock-frequency = <0>; /* Filled in by U-Boot */ 201 + current-speed = <0>; 202 + interrupt-parent = <&UIC0>; 203 + interrupts = <0x1a 0x4>; 204 + }; 205 + 206 + UART1: serial@ef600300 { 207 + device_type = "serial"; 208 + compatible = "ns16550"; 209 + reg = <0xef600300 0x00000008>; 210 + virtual-reg = <0xef600300>; 211 + clock-frequency = <0>; /* Filled in by U-Boot */ 212 + current-speed = <0>; 213 + interrupt-parent = <&UIC0>; 214 + interrupts = <0x1 0x4>; 215 + }; 216 + 217 + IIC0: i2c@ef600400 { 218 + compatible = "ibm,iic-405ex", "ibm,iic"; 219 + reg = <0xef600400 0x00000014>; 220 + interrupt-parent = <&UIC0>; 221 + interrupts = <0x2 0x4>; 222 + #address-cells = <1>; 223 + #size-cells = <0>; 224 + 225 + rtc@68 { 226 + compatible = "dallas,ds1340"; 227 + reg = <0x68>; 228 + }; 229 + }; 230 + 231 + IIC1: i2c@ef600500 { 232 + compatible = "ibm,iic-405ex", "ibm,iic"; 233 + reg = <0xef600500 0x00000014>; 234 + interrupt-parent = <&UIC0>; 235 + interrupts = <0x7 0x4>; 236 + }; 237 + 238 + RGMII0: emac-rgmii@ef600b00 { 239 + compatible = "ibm,rgmii-405ex", "ibm,rgmii"; 240 + reg = <0xef600b00 0x00000104>; 241 + has-mdio; 242 + }; 243 + 244 + EMAC0: ethernet@ef600900 { 245 + linux,network-index = <0x0>; 246 + device_type = "network"; 247 + compatible = "ibm,emac-405ex", "ibm,emac4sync"; 248 + interrupt-parent = <&EMAC0>; 249 + interrupts = <0x0 0x1>; 250 + #interrupt-cells = <1>; 251 + #address-cells = <0>; 252 + #size-cells = <0>; 253 + interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4 254 + /*Wake*/ 0x1 &UIC1 0x1d 0x4>; 255 + reg = <0xef600900 0x000000c4>; 256 + local-mac-address = [000000000000]; /* Filled in by U-Boot */ 257 + mal-device = <&MAL0>; 258 + mal-tx-channel = <0>; 259 + mal-rx-channel = <0>; 260 + cell-index = <0>; 261 + max-frame-size = <9000>; 262 + rx-fifo-size = <4096>; 263 + tx-fifo-size = <2048>; 264 + rx-fifo-size-gige = <16384>; 265 + tx-fifo-size-gige = <16384>; 266 + phy-mode = "rgmii"; 267 + phy-map = <0x00000000>; 268 + rgmii-device = <&RGMII0>; 269 + rgmii-channel = <0>; 270 + has-inverted-stacr-oc; 271 + has-new-stacr-staopc; 272 + }; 273 + 274 + EMAC1: ethernet@ef600a00 { 275 + linux,network-index = <0x1>; 276 + device_type = "network"; 277 + compatible = "ibm,emac-405ex", "ibm,emac4sync"; 278 + interrupt-parent = <&EMAC1>; 279 + interrupts = <0x0 0x1>; 280 + #interrupt-cells = <1>; 281 + #address-cells = <0>; 282 + #size-cells = <0>; 283 + interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4 284 + /*Wake*/ 0x1 &UIC1 0x1f 0x4>; 285 + reg = <0xef600a00 0x000000c4>; 286 + local-mac-address = [000000000000]; /* Filled in by U-Boot */ 287 + mal-device = <&MAL0>; 288 + mal-tx-channel = <1>; 289 + mal-rx-channel = <1>; 290 + cell-index = <1>; 291 + max-frame-size = <9000>; 292 + rx-fifo-size = <4096>; 293 + tx-fifo-size = <2048>; 294 + rx-fifo-size-gige = <16384>; 295 + tx-fifo-size-gige = <16384>; 296 + phy-mode = "rgmii"; 297 + phy-map = <0x00000000>; 298 + rgmii-device = <&RGMII0>; 299 + rgmii-channel = <1>; 300 + has-inverted-stacr-oc; 301 + has-new-stacr-staopc; 302 + }; 303 + 304 + GPIO: gpio@ef600800 { 305 + device_type = "gpio"; 306 + compatible = "ibm,gpio-405ex", "ibm,ppc4xx-gpio"; 307 + reg = <0xef600800 0x50>; 308 + }; 309 + }; 310 + }; 311 + chosen { 312 + linux,stdout-path = "/plb/opb/serial@ef600200"; 313 + }; 314 + };
+21 -1
arch/powerpc/boot/wrapper
··· 163 163 link_address='0x500000' 164 164 pie= 165 165 ;; 166 - miboot|uboot) 166 + miboot|uboot*) 167 167 # miboot and U-boot want just the bare bits, not an ELF binary 168 168 ext=bin 169 169 objflags="-O binary" ··· 286 286 rm -f "$ofile" 287 287 ${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a $membase -e $membase \ 288 288 $uboot_version -d "$vmz" "$ofile" 289 + if [ -z "$cacheit" ]; then 290 + rm -f "$vmz" 291 + fi 292 + exit 0 293 + ;; 294 + uboot-obs600) 295 + rm -f "$ofile" 296 + # obs600 wants a multi image with an initrd, so we need to put a fake 297 + # one in even when building a "normal" image. 298 + if [ -n "$initrd" ]; then 299 + real_rd="$initrd" 300 + else 301 + real_rd=`mktemp` 302 + echo "\0" >>"$real_rd" 303 + fi 304 + ${MKIMAGE} -A ppc -O linux -T multi -C gzip -a $membase -e $membase \ 305 + $uboot_version -d "$vmz":"$real_rd":"$dtb" "$ofile" 306 + if [ -z "$initrd" ]; then 307 + rm -f "$real_rd" 308 + fi 289 309 if [ -z "$cacheit" ]; then 290 310 rm -f "$vmz" 291 311 fi
+83
arch/powerpc/configs/40x/obs600_defconfig
··· 1 + CONFIG_40x=y 2 + CONFIG_EXPERIMENTAL=y 3 + CONFIG_SYSVIPC=y 4 + CONFIG_POSIX_MQUEUE=y 5 + CONFIG_LOG_BUF_SHIFT=14 6 + CONFIG_BLK_DEV_INITRD=y 7 + CONFIG_EXPERT=y 8 + CONFIG_KALLSYMS_ALL=y 9 + CONFIG_MODULES=y 10 + CONFIG_MODULE_UNLOAD=y 11 + # CONFIG_BLK_DEV_BSG is not set 12 + # CONFIG_WALNUT is not set 13 + CONFIG_OBS600=y 14 + CONFIG_NO_HZ=y 15 + CONFIG_HIGH_RES_TIMERS=y 16 + CONFIG_MATH_EMULATION=y 17 + CONFIG_NET=y 18 + CONFIG_PACKET=y 19 + CONFIG_UNIX=y 20 + CONFIG_INET=y 21 + CONFIG_IP_PNP=y 22 + CONFIG_IP_PNP_DHCP=y 23 + CONFIG_IP_PNP_BOOTP=y 24 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 25 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 26 + # CONFIG_INET_XFRM_MODE_BEET is not set 27 + # CONFIG_INET_LRO is not set 28 + # CONFIG_IPV6 is not set 29 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30 + CONFIG_CONNECTOR=y 31 + CONFIG_MTD=y 32 + CONFIG_MTD_CMDLINE_PARTS=y 33 + CONFIG_MTD_OF_PARTS=y 34 + CONFIG_MTD_CHAR=y 35 + CONFIG_MTD_BLOCK=y 36 + CONFIG_MTD_CFI=y 37 + CONFIG_MTD_JEDECPROBE=y 38 + CONFIG_MTD_CFI_AMDSTD=y 39 + CONFIG_MTD_PHYSMAP_OF=y 40 + CONFIG_MTD_NAND=y 41 + CONFIG_MTD_NAND_NDFC=y 42 + CONFIG_PROC_DEVICETREE=y 43 + CONFIG_BLK_DEV_RAM=y 44 + CONFIG_BLK_DEV_RAM_SIZE=35000 45 + CONFIG_NETDEVICES=y 46 + CONFIG_IBM_EMAC=y 47 + CONFIG_IBM_EMAC_RXB=256 48 + CONFIG_IBM_EMAC_TXB=256 49 + # CONFIG_INPUT is not set 50 + # CONFIG_SERIO is not set 51 + # CONFIG_VT is not set 52 + CONFIG_SERIAL_8250=y 53 + CONFIG_SERIAL_8250_CONSOLE=y 54 + CONFIG_SERIAL_8250_EXTENDED=y 55 + CONFIG_SERIAL_8250_SHARE_IRQ=y 56 + CONFIG_SERIAL_OF_PLATFORM=y 57 + # CONFIG_HW_RANDOM is not set 58 + CONFIG_I2C=y 59 + CONFIG_I2C_CHARDEV=y 60 + CONFIG_I2C_IBM_IIC=y 61 + CONFIG_SENSORS_LM75=y 62 + CONFIG_THERMAL=y 63 + # CONFIG_USB_SUPPORT is not set 64 + CONFIG_RTC_CLASS=y 65 + CONFIG_RTC_DRV_DS1307=y 66 + CONFIG_EXT2_FS=y 67 + CONFIG_PROC_KCORE=y 68 + CONFIG_TMPFS=y 69 + CONFIG_CRAMFS=y 70 + CONFIG_NFS_FS=y 71 + CONFIG_NFS_V3=y 72 + CONFIG_ROOT_NFS=y 73 + CONFIG_MAGIC_SYSRQ=y 74 + CONFIG_DEBUG_FS=y 75 + CONFIG_DETECT_HUNG_TASK=y 76 + CONFIG_SYSCTL_SYSCALL_CHECK=y 77 + CONFIG_CRYPTO=y 78 + CONFIG_CRYPTO_CBC=y 79 + CONFIG_CRYPTO_ECB=y 80 + CONFIG_CRYPTO_PCBC=y 81 + CONFIG_CRYPTO_MD5=y 82 + CONFIG_CRYPTO_DES=y 83 + # CONFIG_CRYPTO_ANSI_CPRNG is not set
+10
arch/powerpc/platforms/40x/Kconfig
··· 100 100 Most Virtex designs should use this unless it needs to do some 101 101 special configuration at board probe time. 102 102 103 + config OBS600 104 + bool "OpenBlockS 600" 105 + depends on 40x 106 + default n 107 + select 405EX 108 + select PPC40x_SIMPLE 109 + help 110 + This option enables support for PlatHome OpenBlockS 600 server 111 + 112 + 103 113 config PPC40x_SIMPLE 104 114 bool "Simple PowerPC 40x board support" 105 115 depends on 40x
+2 -1
arch/powerpc/platforms/40x/ppc40x_simple.c
··· 55 55 "amcc,haleakala", 56 56 "amcc,kilauea", 57 57 "amcc,makalu", 58 - "est,hotfoot" 58 + "est,hotfoot", 59 + "plathome,obs600" 59 60 }; 60 61 61 62 static int __init ppc40x_probe(void)