Skip to content
Permalink
Browse files

mpc85xx: add support for OCEDO Panda

CPU:   FSL P1020 (2x 800MHz E500 PPC)
RAM:   1GB DDR3
FLASH: 256MiB NAND
WiFi:  2x Atheros AR9382 2x2:2 abgn
ETH:   2x BCM54616S - 1x BCM53128 8-port switch
LED:   5x LEDs (Power, WiFi1, WiFi2, N/D, SYS)
BTN:   1x RESET

Installation
------------

1. Download initrams kernel image, dtb binary and sysupgrade image.

2. Place initramfs kernel into tftp root directory. Rename to
"panda-uimage-factory".

3. Place dtb binary into tftp root directory. Rename to "panda.fdt".

4. Start tftp server on 192.168.100.8/24.

5. Power up the device with the reset button pressed. It will download
the initrams and dtb via tftp and boot into OpenWRT in RAM.

6. SSH into the device and remove the factory partitions.

 > ubirmvol /dev/ubi0 --name=kernel1
 > ubirmvol /dev/ubi0 --name=rootfs1
 > ubirmvol /dev/ubi0 --name=devicetree1

You will have around 60 MiB of free space with that.

You can also delete "kernel2", "devicetree2", "rootfs2" and "storage"
respectively in case you do not want to go back to the vendor firmware.

7. Modify the U-Boot bootcmd to allow for booting OpenWRT

 > fw_setenv bootcmd_owrt "ubi part ubi && ubi read 0x1000000 kernel
   && bootm 0x1000000"

 > fw_setenv bootargs_owrt "setenv bootargs console=ttyS0,115200
   ubi.mtd=3,2048"

 > fw_setenv bootcmd "run bootargs_owrt; run bootcmd_owrt"

8. Transfer the sysupgrade image via scp into the /tmp directory.

9. Upgrade the device

 > sysupgrade -n /tmp/<imagename>

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information...
blocktrron authored and chunkeey committed Jan 16, 2019
1 parent 90bfbed commit b368373fab45f31963cd2bc1c6ab90e0a577e611
@@ -0,0 +1,22 @@
#!/bin/sh

[ -e /etc/config/ubootenv ] && exit 0

touch /etc/config/ubootenv

. /lib/uboot-envtools.sh
. /lib/functions.sh

board=$(board_name)

case "$board" in
ocedo,panda)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000"
;;
esac

config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv

exit 0
@@ -13,6 +13,11 @@ case "$board" in
aerohive,hiveap-330)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
ocedo,panda)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "6:lan" "7:lan" "8u@eth0"
;;
tplink,tl-wdr4900-v1)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
@@ -12,6 +12,11 @@ PHYNBR=${DEVPATH##*/phy}
board=$(board_name)

case "$board" in
ocedo,panda)
WMAC=wmac$(($PHYNBR + 1))
MAC=$(mtd_get_mac_ascii uboot-env0 ${WMAC})
echo ${MAC} > /sys${DEVPATH}/macaddress
;;
sophos,red-15w-rev1)
echo $(mtd_get_mac_ascii u-boot-env ethaddr) > /sys${DEVPATH}/macaddress
;;
@@ -13,6 +13,7 @@ platform_do_upgrade() {
local board=$(board_name)

case "$board" in
ocedo,panda|\
sophos,red-15w-rev1)
nand_do_upgrade "$ARGV"
;;
@@ -242,6 +242,7 @@ CONFIG_OLD_SIGSUSPEND=y
# CONFIG_P1022_RDK is not set
# CONFIG_P1023_RDB is not set
CONFIG_PAGE_OFFSET=0xc0000000
# CONFIG_PANDA is not set
CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEASPM=y
@@ -0,0 +1,264 @@
// SPDX-License-Identifier: GPL-2.0-or-later or MIT

/include/ "fsl/p1020si-pre.dtsi"
/ {
model = "OCEDO Panda";
compatible = "ocedo,panda";

aliases {
led-boot = &system_blue;
led-failsafe = &system_blue;
led-running = &system_blue;
led-upgrade = &system_blue;
};

chosen {
/* Needed for initramfs */
bootargs-override = "console=ttyS0,115200 ubi.mtd=3,2048";
};

memory {
device_type = "memory";
};

lbc: localbus@ffe05000 {
reg = <0 0xffe05000 0 0x1000>;
ranges = <0x0 0x0 0x0 0xec000000 0x04000000
0x1 0x0 0x0 0xff800000 0x00040000
0x2 0x0 0x0 0xffa00000 0x00020000
0x3 0x0 0x0 0xffb00000 0x00020000>;

nand@1,0 {
compatible = "fsl,p1020-fcm-nand", "fsl,elbc-fcm-nand";
reg = <0x1 0x0 0x40000>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
reg = <0x0 0xa0000>;
label = "uboot";
read-only;
};

partition@a0000 {
reg = <0xa0000 0x20000>;
label = "uboot-env0";
};

partition@c0000 {
reg = <0xc0000 0x40000>;
label = "uboot-env1";
};

partition@100000 {
reg = <0x100000 0xff00000>;
label = "ubi";
};
};
};
};

soc: soc@ffe00000 {
ranges = <0x0 0x0 0xffe00000 0x100000>;

i2c@3000 {
rtc@68 {
compatible = "dallas,ds1339";
reg = <0x68>;
};
};

gpio0: gpio-controller@fc00 {
};

mdio@24000 {
phy0: ethernet-phy@8 {
reg = <0x8>;
};

phy1: ethernet-phy@9 {
reg = <0x9>;
};

switch0: ethernet-phy@0 {
reg = <0x0>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;
label = "lan1";
};

port@1 {
reg = <1>;
label = "lan2";
};

port@2 {
reg = <2>;
label = "lan3";
};

port@3 {
reg = <3>;
label = "lan4";
};

port@4 {
reg = <4>;
label = "lan5";
};

port@5 {
reg = <5>;
label = "lan6";
};

port@6 {
reg = <6>;
label = "lan7";
};

port@7 {
reg = <7>;
label = "lan8";
};

port@8 {
reg = <8>;
label = "cpu";

fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
};

mdio@25000 {
tbi_phy0: tbi-phy@11 {
reg = <0x11>;
};
};

mdio@26000 {
tbi_phy1: tbi-phy@11 {
reg = <0x11>;
};
};

enet0: ethernet@b0000 {
phy-connection-type = "rgmii-id";
phy-handle = <&switch0>;

fixed-link {
speed = <1000>;
full-duplex;
};
};

enet1: ethernet@b1000 {
phy-connection-type = "sgmii";
phy-handle = <&phy0>;

tbi-handle = <&tbi_phy0>;
};

enet2: ethernet@b2000 {
phy-connection-type = "sgmii";
phy-handle = <&phy1>;

tbi-handle = <&tbi_phy1>;
};

usb@22000 {
phy_type = "ulpi";
dr_mode = "host";
};

usb@23000 {
status = "disabled";
};
};

pci0: pcie@ffe09000 {
ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
reg = <0 0xffe09000 0 0x1000>;
pcie@0 {
ranges = <0x2000000 0x0 0xa0000000
0x2000000 0x0 0xa0000000
0x0 0x20000000

0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;
};
};

pci1: pcie@ffe0a000 {
reg = <0 0xffe0a000 0 0x1000>;
ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
pcie@0 {
ranges = <0x2000000 0x0 0x80000000
0x2000000 0x0 0x80000000
0x0 0x20000000

0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;
};
};

leds {
compatible = "gpio-leds";

power {
gpios = <&gpio0 0 0>;
label = "panda:green:power";
default-state = "on";
};

wlan0 {
gpios = <&gpio0 1 0>;
label = "panda:yellow:wlan0";
linux,default-trigger = "phy0tpt";
};

wlan1 {
gpios = <&gpio0 2 0>;
label = "panda:red:wlan1";
linux,default-trigger = "phy1tpt";
};

tbd_orange {
gpios = <&gpio0 3 0>;
label = "panda:orange:tbd";
};

system_blue: system {
gpios = <&gpio0 4 0>;
label = "panda:blue:system";
};
};

buttons {
compatible = "gpio-keys";

reset {
label = "Reset button";
gpios = <&gpio0 6 1>;
linux,code = <0x198>;
};
};
};
/include/ "fsl/p1020si-post.dtsi"

0 comments on commit b368373

Please sign in to comment.
You can’t perform that action at this time.