[poky] [PATCH 1/2] linux-yocto: allow configuration of MAC addresses for mpc8315e-rdb
Bruce Ashfield
bruce.ashfield at gmail.com
Thu Jul 14 08:57:42 PDT 2011
On Thu, Jul 14, 2011 at 11:13 AM, Paul Eggleton
<paul.eggleton at linux.intel.com> wrote:
> 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]
>
> Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
> ---
> .../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
>
> diff --git a/meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch b/meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch
> new file mode 100644
> index 0000000..d575d01
> --- /dev/null
> +++ b/meta-yocto/recipes-kernel/linux/linux-yocto/mpc8315e-rdb-dts.patch
> @@ -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 <paul.eggleton at linux.intel.com>
> +
> +--- 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>;
> diff --git a/meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend b/meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend
> index b12dcef..a1c50a2 100644
> --- a/meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend
> +++ b/meta-yocto/recipes-kernel/linux/linux-yocto_2.6.37.bbappend
> @@ -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
> +}
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
> +
> --
> 1.7.4.1
>
> _______________________________________________
> poky mailing list
> poky at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
>
--
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
More information about the poky
mailing list