[PATCH linux dev-4.7] ARM: dts: aspeed: fix flash module device nodes
Joel Stanley
joel at jms.id.au
Wed Nov 16 12:26:54 AEDT 2016
On Tue, Nov 15, 2016 at 8:53 PM, Cédric Le Goater <clg at kaod.org> wrote:
> The "label" property can not be used under the flash module device
> nodes. Remove them and use 'pnor' in the device node name to identify
> the host pnor flash module from user space. Also introduce a
> 'partitions' node to describe the bmc layout.
>
> Signed-off-by: Cédric Le Goater <clg at kaod.org>
Thanks for sending this. For reference userspace sees this now on ast2400:
# cat /proc/mtd
dev: size erasesize name
mtd0: 00060000 00001000 "u-boot"
mtd1: 00020000 00001000 "u-boot-env"
mtd2: 00280000 00001000 "kernel"
mtd3: 001c0000 00001000 "initramfs"
mtd4: 01740000 00001000 "rofs"
mtd5: 00400000 00001000 "rwfs"
mtd6: 02000000 00010000 "1e630000.spi:pnor at 0"
And on ast2500:
# cat /proc/mtd
dev: size erasesize name
mtd0: 00060000 00001000 "u-boot"
mtd1: 00020000 00001000 "u-boot-env"
mtd2: 00280000 00001000 "kernel"
mtd3: 001c0000 00001000 "initramfs"
mtd4: 01740000 00001000 "rofs"
mtd5: 00400000 00001000 "rwfs"
mtd6: 02000000 00001000 "1e620000.flash-controller:flash at 1"
mtd7: 08000000 00001000 "1e630000.flash-controller:pnor at 0"
pflash uses strstr to match on a mtd device with 'pnor' in it, so this
should maintain compatibility with that tool.
Reviewed-by: Joel Stanley <joel at jms.id.au>
Cheers,
Joel
> ---
> arch/arm/boot/dts/aspeed-ast2500-evb.dts | 2 +-
> arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts | 3 +--
> arch/arm/boot/dts/aspeed-bmc-opp-firestone.dts | 3 +--
> arch/arm/boot/dts/aspeed-bmc-opp-flash-layout.dtsi | 17 +++++++++--------
> arch/arm/boot/dts/aspeed-bmc-opp-garrison.dts | 3 +--
> arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts | 3 +--
> arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 3 +--
> arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 3 +--
> arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts | 3 +--
> arch/arm/boot/dts/aspeed-g5.dtsi | 4 ++--
> 10 files changed, 19 insertions(+), 25 deletions(-)
>
> diff --git a/arch/arm/boot/dts/aspeed-ast2500-evb.dts b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> index 37b6793698e0..3dc472ae10e9 100644
> --- a/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> +++ b/arch/arm/boot/dts/aspeed-ast2500-evb.dts
> @@ -30,7 +30,7 @@
>
> &spi1 {
> status = "okay";
> - flash at 0 {
> + pnor at 0 {
> status = "okay";
> };
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts b/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
> index 6ca618bd331d..802ce9557836 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
> @@ -40,10 +40,9 @@
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "aspeed,ast2400-smc";
> - flash {
> + pnor at 0 {
> reg = < 0 >;
> compatible = "jedec,spi-nor" ;
> - label = "pnor";
> };
> };
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-firestone.dts b/arch/arm/boot/dts/aspeed-bmc-opp-firestone.dts
> index e677e9ff00b8..005ff89e0c10 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-firestone.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-firestone.dts
> @@ -61,10 +61,9 @@
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "aspeed,ast2400-smc";
> - flash {
> + pnor at 0 {
> reg = < 0 >;
> compatible = "jedec,spi-nor" ;
> - label = "pnor";
> };
> };
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-flash-layout.dtsi b/arch/arm/boot/dts/aspeed-bmc-opp-flash-layout.dtsi
> index ca8639b52f6d..6cfadb42368f 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-flash-layout.dtsi
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-flash-layout.dtsi
> @@ -1,28 +1,29 @@
> -/* This file is the label for the bmc primary flash and its partitions */
> - label = "bmc";
> + partitions {
> #address-cells = < 1 >;
> #size-cells = < 1 >;
> - u-boot {
> + compatible = "fixed-partitions";
> + u-boot at 0 {
> reg = < 0 0x60000 >;
> label = "u-boot";
> };
> - u-boot-env {
> + u-boot-env at 60000 {
> reg = < 0x60000 0x20000 >;
> label = "u-boot-env";
> };
> - kernel {
> + kernel at 80000 {
> reg = < 0x80000 0x280000 >;
> label = "kernel";
> };
> - initramfs {
> + initramfs at 300000 {
> reg = < 0x300000 0x1c0000 >;
> label = "initramfs";
> };
> - rofs {
> + rofs at 0c0000 {
> reg = < 0x4c0000 0x1740000 >;
> label = "rofs";
> };
> - rwfs {
> + rwfs at 1c00000 {
> reg = < 0x1c00000 0x400000 >;
> label = "rwfs";
> };
> + };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-garrison.dts b/arch/arm/boot/dts/aspeed-bmc-opp-garrison.dts
> index a4471fb3b36b..92b29d1c665b 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-garrison.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-garrison.dts
> @@ -41,10 +41,9 @@
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "aspeed,ast2400-smc";
> - flash {
> + pnor at 0 {
> reg = < 0 >;
> compatible = "jedec,spi-nor" ;
> - label = "pnor";
> /* spi-max-frequency = <>; */
> /* m25p,fast-read; */
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts b/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
> index 0fd60c4eafad..8fe248f4d531 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
> @@ -58,10 +58,9 @@
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "aspeed,ast2400-smc";
> - flash {
> + pnor at 0 {
> reg = < 0 >;
> compatible = "jedec,spi-nor" ;
> - label = "pnor";
> };
> };
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> index 4c4c547fe412..9845e6ca0de9 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> @@ -29,7 +29,6 @@
> };
> flash at 1 {
> status = "okay";
> - label = "alt";
> };
> };
>
> @@ -38,7 +37,7 @@
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_spi1_default>;
>
> - flash at 0 {
> + pnor at 0 {
> status = "okay";
> };
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> index 7badbda288d3..c7458ae6efd7 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> @@ -29,7 +29,6 @@
> };
> flash at 1 {
> status = "okay";
> - label = "alt";
> };
> };
>
> @@ -38,7 +37,7 @@
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_spi1_default>;
>
> - flash at 0 {
> + pnor at 0 {
> status = "okay";
> };
> };
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> index 673bab8006e7..8ef4ecec17cc 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> @@ -58,9 +58,8 @@
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_spi1_default>;
>
> - flash at 0 {
> + pnor at 0 {
> status = "okay";
> - label = "pnor";
> };
> };
>
> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
> index be95fd42dbd7..099d0aab87b6 100644
> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
> @@ -58,12 +58,12 @@
> #size-cells = <0>;
> compatible = "aspeed,ast2500-smc";
> status = "disabled";
> - flash at 0 {
> + pnor at 0 {
> reg = < 0 >;
> compatible = "jedec,spi-nor";
> status = "disabled";
> };
> - flash at 1 {
> + pnor at 1 {
> reg = < 1 >;
> compatible = "jedec,spi-nor";
> status = "disabled";
> --
> 2.7.4
>
More information about the openbmc
mailing list