Skip to contentSkip to conversation

MPC8315E-RDB fixes

PATCH In review Paul Eggleton 3 participants 7 messages Jul 14, 2011 – Jul 15, 2011

lore
Share & tools
lore
#0 lore raw

cover MPC8315E-RDB fixes

Now that I've had a chance to test Poky on an MPC8315E-RDB I've been able to fix one issue and improve the instructions a little.

The following changes since commit 068839698fe192d8846c0ed4db65861448e8e524:

eglibc: fix runtime assertion failure (2011-07-13 12:34:30 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib paule/mpc8315erdb-fixes
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/mpc8315erdb-fixes

Paul Eggleton (2):
linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb README.hardware: update MPC8315E-RDB instructions

 README.hardware                                    |   62 +++++++++++++++-----
 .../linux/linux-yocto/mpc8315e-rdb-dts.patch       |   28 +++++++++
 .../linux/linux-yocto_2.6.37.bbappend              |   16 +++++
 3 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/2 linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb

Add MPC8315ERDB_MAC0 and MPC8315ERDB_MAC1 variables to allow specifying the MAC addresses to be used in the dtb. The default is 00:00:00:00:00:00, however with the version of u-boot supplied from the factory, these must match the hardware or configuring the network at boot time will fail, and thus booting from an NFS root will not work.

Newer versions of u-boot support passing MAC address values through and would not need this fix; however in the absence of a safe established procedure for updating u-boot on these boards this workaround will have to suffice.

Addresses [YOCTO #1227]

---
 .../linux/linux-yocto/mpc8315e-rdb-dts.patch       |   28 ++++++++++++++++++++
 .../linux/linux-yocto_2.6.37.bbappend              |   16 +++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch
meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch new file +28 -0
new file mode 100644
index 0000000..d575d01
@@ -0,0 +1,28 @@
+Enable configuration of the MAC addresses for the two ethernet ports on
+the MPC8315E-RDB. This modifies the dts file, do_configure will use
+sed to substitute the appropriate values in, and they will be built into
+the dtb file.
+
+Upstream-status: Inappropriate [configuration]
+Signed-off-by: Paul Eggleton <[email protected]>
+
+--- linux/arch/powerpc/boot/dts/mpc8315erdb.dts
++++ linux/arch/powerpc/boot/dts/mpc8315erdb.dts
+@@ -205,7 +205,7 @@
+ 			compatible = "gianfar";
+ 			reg = <0x24000 0x1000>;
+ 			ranges = <0x0 0x24000 0x1000>;
+-			local-mac-address = [ 00 00 00 00 00 00 ];
++			local-mac-address = [ SED_MAC_ADDRESS_0 ];
+ 			interrupts = <32 0x8 33 0x8 34 0x8>;
+ 			interrupt-parent = <&ipic>;
+ 			tbi-handle = <&tbi0>;
+@@ -248,7 +248,7 @@
+ 			compatible = "gianfar";
+ 			reg = <0x25000 0x1000>;
+ 			ranges = <0x0 0x25000 0x1000>;
+-			local-mac-address = [ 00 00 00 00 00 00 ];
++			local-mac-address = [ SED_MAC_ADDRESS_1 ];
+ 			interrupts = <35 0x8 36 0x8 37 0x8>;
+ 			interrupt-parent = <&ipic>;
+ 			tbi-handle = <&tbi1>;
meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend +16 -0
index b12dcef..a1c50a2 100644
@@ -13,3 +13,19 @@ COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
 COMPATIBLE_MACHINE_routerstationpro = "routerstationpro"
 COMPATIBLE_MACHINE_beagleboard = "beagleboard"
 COMPATIBLE_MACHINE_atom-pc = "atom-pc"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append_mpc8315e-rdb = " file://mpc8315e-rdb-dts.patch"
+
+do_configure_prepend_mpc8315e-rdb() {
+	if [ -z "${MPC8315ERDB_MAC0}" -o -z "${MPC8315ERDB_MAC1}" ] ; then
+		echo "Please set MPC8315ERDB_MAC0 and MPC8315ERDB_MAC1 in your local.conf (based on"
+		echo "the MAC addresses from your hardware, you can use the bdinfo command in u-boot)"
+		exit 1
+	fi
+	MAC0=`echo ${MPC8315ERDB_MAC0} | sed 's/:/ /g'`
+	MAC1=`echo ${MPC8315ERDB_MAC1} | sed 's/:/ /g'`
+	sed -i -e "s/SED_MAC_ADDRESS_0/$MAC0/g" ${WORKDIR}/linux/arch/powerpc/boot/dts/mpc8315erdb.dts
+	sed -i -e "s/SED_MAC_ADDRESS_1/$MAC1/g" ${WORKDIR}/linux/arch/powerpc/boot/dts/mpc8315erdb.dts
+}
+
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH 1/2] linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb

Quoted 67 lines · Paul Eggleton

Add MPC8315ERDB_MAC0 and MPC8315ERDB_MAC1 variables to allow specifying the MAC addresses to be used in the dtb. The default is 00:00:00:00:00:00, however with the version of u-boot supplied from the factory, these must match the hardware or configuring the network at boot time will fail, and thus booting from an NFS root will not work.

Newer versions of u-boot support passing MAC address values through and would not need this fix; however in the absence of a safe established procedure for updating u-boot on these boards this workaround will have to suffice.

Addresses [YOCTO #1227]

---
 .../linux/linux-yocto/mpc8315e-rdb-dts.patch       |   28 ++++++++++++++++++++ .../linux/linux-yocto_2.6.37.bbappend              |   16 +++++++++++

 2 files changed, 44 insertions(+), 0 deletions(-)

 create mode 100644 meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch

meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch new file +28 -0
new file mode 100644
index 0000000..d575d01
@@ -0,0 +1,28 @@
+Enable configuration of the MAC addresses for the two ethernet ports on
+the MPC8315E-RDB. This modifies the dts file, do_configure will use
+sed to substitute the appropriate values in, and they will be built into
+the dtb file.
+
+Upstream-status: Inappropriate [configuration]
+Signed-off-by: Paul Eggleton <[email protected]>
+
+--- linux/arch/powerpc/boot/dts/mpc8315erdb.dts
++++ linux/arch/powerpc/boot/dts/mpc8315erdb.dts
+@@ -205,7 +205,7 @@
+                       compatible = "gianfar";
+                       reg = <0x24000 0x1000>;
+                       ranges = <0x0 0x24000 0x1000>;
+-                      local-mac-address = [ 00 00 00 00 00 00 ];
++                      local-mac-address = [ SED_MAC_ADDRESS_0 ];
+                       interrupts = <32 0x8 33 0x8 34 0x8>;
+                       interrupt-parent = <&ipic>;
+                       tbi-handle = <&tbi0>;
+@@ -248,7 +248,7 @@
+                       compatible = "gianfar";
+                       reg = <0x25000 0x1000>;
+                       ranges = <0x0 0x25000 0x1000>;
+-                      local-mac-address = [ 00 00 00 00 00 00 ];
++                      local-mac-address = [ SED_MAC_ADDRESS_1 ];
+                       interrupts = <35 0x8 36 0x8 37 0x8>;
+                       interrupt-parent = <&ipic>;
+                       tbi-handle = <&tbi1>;
meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend +0 -0
index b12dcef..a1c50a2 100644
@@ -13,3 +13,19 @@ COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"

 COMPATIBLE_MACHINE_routerstationpro = "routerstationpro" COMPATIBLE_MACHINE_beagleboard = "beagleboard" COMPATIBLE_MACHINE_atom-pc = "atom-pc"

meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend +5 -0
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append_mpc8315e-rdb = " file://mpc8315e-rdb-dts.patch"
+
+do_configure_prepend_mpc8315e-rdb() {

meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb" · line 30

Quoted 10 lines
meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend +10 -0
+       if [ -z "${MPC8315ERDB_MAC0}" -o -z "${MPC8315ERDB_MAC1}" ] ; then
+               echo "Please set MPC8315ERDB_MAC0 and MPC8315ERDB_MAC1 in your local.conf (based on"
+               echo "the MAC addresses from your hardware, you can use the bdinfo command in u-boot)"
+               exit 1
+       fi
+       MAC0=`echo ${MPC8315ERDB_MAC0} | sed 's/:/ /g'`
+       MAC1=`echo ${MPC8315ERDB_MAC1} | sed 's/:/ /g'`
+       sed -i -e "s/SED_MAC_ADDRESS_0/$MAC0/g" ${WORKDIR}/linux/arch/powerpc/boot/dts/mpc8315erdb.dts
+       sed -i -e "s/SED_MAC_ADDRESS_1/$MAC1/g" ${WORKDIR}/linux/arch/powerpc/boot/dts/mpc8315erdb.dts
+}

The change looks fine, in the sense that it'll work, but it's a lot of hoops to jump through for the mac address. In the past, we've solved this by allowing the mac address to be specified via the bootline, which we could then simply drop into the boot environment and have it work more easily.

I didn't think of this when we were talking about this issue, but now that I see the change ... it's been faulted into the right memory banks.

I'll dig up these patches, and we can take them for a spin and hopefully we can drop this part of the series.

Bruce

Quoted 9 lines

+
--
1.7.4.1

_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#3 lore raw

Re: [PATCH 1/2] linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb

Quoted 11 lines · On Thursday 14 July 2011 16:57:42 Bruce Ashfield wrote:

The change looks fine, in the sense that it'll work, but it's a lot of hoops to jump through for the mac address. In the past, we've solved this by allowing the mac address to be specified via the bootline, which we could then simply drop into the boot environment and have it work more easily.

I didn't think of this when we were talking about this issue, but now that I see the change ... it's been faulted into the right memory banks.

I'll dig up these patches, and we can take them for a spin and hopefully we can drop this part of the series.

If we have a better solution that would make things easier for the user I'd definitely prefer it over this.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#4 lore raw

Re: [PATCH 1/2] linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb

Quoted 7 lines · Paul Eggleton
Quoted 6 lines · On Thursday 14 July 2011 16:57:42 Bruce Ashfield wrote:

The change looks fine, in the sense that it'll work, but it's a lot of hoops to jump through for the mac address. In the past, we've solved this by allowing the mac address to be specified via the bootline, which we could then simply drop into the boot environment and have it work more easily.

Quoted 8 lines
Quoted 5 lines

I didn't think of this when we were talking about this issue, but now that I see the change ... it's been faulted into the right memory banks.

I'll dig up these patches, and we can take them for a spin and hopefully we can drop this part of the series.

If we have a better solution that would make things easier for the user I'd definitely prefer it over this.

I know we mentioned this on IRC, but why not just ask the user to upgrade U-Boot? This isn't a bleeding edge board so that shouldn't be difficult...

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#5 lore raw

Re: [PATCH 1/2] linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb

Quoted 14 lines · Tom Rini
Quoted 13 lines · Paul Eggleton
Quoted 11 lines · On Thursday 14 July 2011 16:57:42 Bruce Ashfield wrote:

The change looks fine, in the sense that it'll work, but it's a lot of hoops to jump through for the mac address. In the past, we've solved this by allowing the mac address to be specified via the bootline, which we could then simply drop into the boot environment and have it work more easily.

I didn't think of this when we were talking about this issue, but now that I see the change ... it's been faulted into the right memory banks.

I'll dig up these patches, and we can take them for a spin and hopefully we can drop this part of the series.

Quoted 6 lines
Quoted 2 lines

If we have a better solution that would make things easier for the user I'd definitely prefer it over this.

I know we mentioned this on IRC, but why not just ask the user to upgrade U-Boot?  This isn't a bleeding edge board so that shouldn't be difficult...

That's definitely the right solution, and the one that I'm talking about again via the bug/email. The only reason we are not quite there yet, is due to an unfortunate board bricking episode. Once we've got jtag and a few minutes, we'll revisit the u-boot update (it should be trivial) and once confirmed simply go with that.

So that being said, I'm definitely leaning away from any patches like this, just so we don't have anything to undo once later.

Cheers,

Bruce

Quoted 9 lines

--
Tom Rini
Mentor Graphics Corporation
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#6 lore raw

PATCH 2/2 README.hardware: update MPC8315E-RDB instructions

In reply to Paul Eggleton

Update the instructions for setting up the MPC8315E-RDB so that they are clearer, use correct filenames, match the other board instructions more closely, and include details about how to set the MAC address variables prior to building. Additionally, add notes about ordering MPC8315E-RDBA.

---
 README.hardware |   62 ++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 48 insertions(+), 14 deletions(-)
README.hardware +48 -14
index 3602957..a471034 100644
@@ -239,30 +239,64 @@ software development of network attached storage (NAS) and digital media server
 applications. The MPC8315E-RDB features the PowerQUICC II Pro processor, which
 includes a built-in security accelerator.
 
+(Note: you may find it easier to order MPC8315E-RDBA; this appears to be the
+same board in an enclosure with accessories. In any case it is fully
+compatible with the instructions given here.)
+
 Setup instructions
 ------------------
 
 You will need the following:
-* nfs root setup on your workstation
-* tftp server installed on your workstation
+* NFS root setup on your workstation
+* TFTP server installed on your workstation
+* Null modem cable connected from your workstation to the first serial port
+  on the board
+* Ethernet connected to the first ethernet port on the board
+
+--- Preparation ---
+
+Prior to building, obtain the ethernet MAC addresses from your MPC8315E-RDB
+system and set them in your build configuration:
+
+ 1. Connect the board's first serial port to your workstation and then start up
+    your favourite serial terminal so that you will be able to interact with
+    the serial console. If you don't have a favourite, picocom is suggested:
+
+  $ picocom /dev/ttyUSB0 -b 115200
+
+ 2. Power up or reset the board and press a key on the terminal when prompted
+    to get to the U-Boot command line
+
+ 3. Type bdinfo, press enter, and look for the ethaddr and eth1addr values
+
+ 4. Edit your local.conf and set MPC8315ERDB_MAC0 and MPC8315ERDB_MAC1 to the
+    ethaddr and eth1addr values (respectively) obtained in the previous step.
+
+Now you can build the desired image as normal. If you already built an image
+before this step you will need to rebuild the kernel (virtual/kernel target)
+before continuing.
+
+--- Booting from NFS root ---
+
+Load the kernel and dtb (device tree blob), and boot the system as follows:
 
-Load the kernel and boot it as follows:
+ 1. Get the kernel (uImage-mpc8315e-rdb.bin) and dtb (uImage-mpc8315e-rdb.dtb)
+    files from the Poky build tmp/deploy directory, and make them available on
+    your TFTP server.
 
- 1. Get the kernel (uImage.mpc8315erdb) and dtb (mpc8315erdb.dtb) files from
-    the Poky build tmp/deploy directory, and make them available on your tftp
-    server.
+ 2. Get access to the U-Boot command line as above
 
- 2. Set up the environment in U-Boot:
+ 3. Set up the environment in U-Boot:
 
- =>setenv ipaddr <board ip>
- =>setenv serverip <tftp server ip>
- =>setenv bootargs root=/dev/nfs rw nfsroot=<nfsroot ip>:<rootfs path> ip=<board ip>:<server ip>:<gateway ip>:255.255.255.0:mpc8315e:eth0:off console=ttyS0,115200
+ => setenv ipaddr <board ip>
+ => setenv serverip <tftp server ip>
+ => setenv bootargs root=/dev/nfs rw nfsroot=<nfsroot ip>:<rootfs path> ip=<board ip>:<server ip>:<gateway ip>:255.255.255.0:mpc8315e:eth0:off console=ttyS0,115200
 
- 3. Download kernel and dtb to boot kernel.
+ 4. Download the kernel and dtb, and boot:
 
- =>tftp 800000 uImage.mpc8315erdb
- =>tftp 780000 mpc8315erdb.dtb
- =>bootm 800000 - 780000
+ => tftp 800000 uImage-mpc8315e-rdb.bin
+ => tftp 780000 uImage-mpc8315e-rdb.dtb
+ => bootm 800000 - 780000
 
 
 Ubiquiti Networks RouterStation Pro (routerstationpro)
Signature · 1 line
1.7.4.1