From 32181ca03d77993cd7f4ecd66286fad7ebff170f Mon Sep 17 00:00:00 2001 From: "zhikui.cui" Date: Fri, 1 Aug 2025 13:35:33 +0800 Subject: [PATCH] NAND: unify slcnand&spinand mtdparts code [1/1] PD#SWPL-224631 Problem: mtd partition in spinand and slcnand have no difference, should unify there code Solution: 1. spinand partitions table define in dts keep same format with slc nand: partitions { #address = <1>; #size-cells= <1>; partition@n { label = "part_name"; reg = < ... >; }; }; instead of: partition = <&partitions>; partitions: partitions{ part_name { offset = < ... >; size = < ... >; }; } 2. the definition of SLCNAND bl_mode in dts remains the same as that of SPINAND bl_mode = <0> : NAND_FIPMODE_COMPACT; bl_mode = <1> : NAND_FIPMODE_DISCRETE; bl_mode = <2> : NAND_FIPMODE_ADVANCE; in this way, SLCNAND does not need to define bl2ex_mode in platform data by meosn_nand.c Change-Id: I32d1b1b55e6c927d73937f8f748d8285f3c6dff3 Signed-off-by: zhikui.cui --- .../boot/dts/amlogic/a1-a113l-ad403-spk.dts | 55 ++- arch/arm/boot/dts/amlogic/c2_c305x_af400.dts | 55 ++- .../amlogic/c3_c302x_aw402_128m_recovery.dts | 90 ++-- .../c3_c302x_aw402_128m_spinor_recovery.dts | 90 ++-- .../amlogic/c3_c302x_aw402_256m_recovery.dts | 90 ++-- .../c3_c302x_aw402_256m_spinor_recovery.dts | 90 ++-- .../c3_c302x_aw409-emmc_128m_recovery.dts | 83 ++-- .../c3_c302x_aw409-emmc_256m_recovery.dts | 83 ++-- .../amlogic/c3_c302x_aw409_128m_recovery.dts | 83 ++-- .../c3_c302x_aw409_128m_spinor_recovery.dts | 83 ++-- .../amlogic/c3_c302x_aw409_256m_recovery.dts | 83 ++-- .../c3_c302x_aw409_256m_spinor_recovery.dts | 83 ++-- arch/arm/boot/dts/amlogic/c3_c308l_aw419.dts | 83 ++-- .../amlogic/c3_c308l_aw429_128m_recovery.dts | 83 ++-- .../amlogic/c3_c308l_aw429_256m_recovery.dts | 83 ++-- .../boot/dts/amlogic/c3_c30xx_aw402_128m.dtsi | 90 ++-- .../boot/dts/amlogic/c3_c30xx_aw402_256m.dtsi | 90 ++-- .../boot/dts/amlogic/c3_c30xx_aw409_128m.dtsi | 83 ++-- .../boot/dts/amlogic/c3_c30xx_aw409_256m.dtsi | 83 ++-- arch/arm/boot/dts/amlogic/c3_pxp.dts | 76 ++-- arch/arm/boot/dts/amlogic/meson-s4.dtsi | 2 +- arch/arm/boot/dts/amlogic/meson-s4d.dtsi | 2 +- arch/arm/boot/dts/amlogic/meson-s7.dtsi | 2 +- arch/arm/boot/dts/amlogic/meson-s7d.dtsi | 2 +- arch/arm/boot/dts/amlogic/meson-sc2.dtsi | 2 +- arch/arm/boot/dts/amlogic/mesont6d.dtsi | 2 +- arch/arm/boot/dts/amlogic/mesont6w.dtsi | 2 +- arch/arm/boot/dts/amlogic/s1a_pxp.dts | 55 ++- .../dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts | 2 +- .../dts/amlogic/s4_s805x2_aq222_drm_1g.dts | 2 +- .../boot/dts/amlogic/s4_s905y4_ap222_drm.dts | 2 +- .../dts/amlogic/s4_s905y4_ap222_drm_1g.dts | 2 +- .../dts/amlogic/s4_s905y4_ap222_linux.dts | 2 +- .../dts/amlogic/s4_s905y4_ap222_linux_1g.dts | 2 +- .../dts/amlogic/s4d_s805c1a_bf201_256m.dts | 2 +- .../dts/amlogic/s4d_s805c3_aq2432_256m.dts | 2 +- .../dts/amlogic/s4d_s805c3_aq2432_512m.dts | 2 +- .../boot/dts/amlogic/s4d_s805c3_t215_256m.dts | 2 +- .../boot/dts/amlogic/s4d_s805c3_t215_512m.dts | 2 +- .../dts/amlogic/s4d_s905c3_ap232_1g_linux.dts | 2 +- .../boot/dts/amlogic/s4d_s905c3_ap232_drm.dts | 2 +- .../dts/amlogic/s4d_s905c3_ap232_linux.dts | 2 +- .../dts/amlogic/s4d_s905y4_ap222_linux.dts | 2 +- .../dts/amlogic/s4d_s905y4_ap223_linux.dts | 2 +- arch/arm/boot/dts/amlogic/s7_pxp.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp201_1g.dts | 2 +- .../dts/amlogic/s7_s805x3_bp201_linux_1g.dts | 2 +- .../amlogic/s7_s805x3_bp201_linux_512M.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp202_1g.dts | 2 +- .../amlogic/s7_s805x3_bp203_linux_512M.dts | 2 +- arch/arm/boot/dts/amlogic/s7_s905y5_bh201.dts | 2 +- .../dts/amlogic/s7_s905y5_bh201_linux.dts | 2 +- .../amlogic/s7_s905y5_bh201_linux_512m.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm201.dts | 2 +- .../dts/amlogic/s7d_s905x5m_bm201_linux.dts | 2 +- .../dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm202.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm209.dts | 2 +- .../boot/dts/amlogic/sc2_s905x4_ah212_drm.dts | 57 ++- .../dts/amlogic/sc2_s905x4_ah212_drm_1g.dts | 57 ++- .../dts/amlogic/t6d_t950d5_br301_1.5g.dts | 2 +- .../amlogic/t6d_t950d5_br301_1.5g_linux.dts | 2 +- .../boot/dts/amlogic/t6d_t950d5_br301_1g.dts | 2 +- .../dts/amlogic/t6d_t950d5_br301_1g_linux.dts | 2 +- .../amlogic/t6d_t950d5_br301_512M_linux.dts | 2 +- .../dts/amlogic/t6d_t950d5_br309_1.5g.dts | 2 +- .../boot/dts/amlogic/t6d_t950d5_br309_1g.dts | 2 +- .../boot/dts/amlogic/a1-a113l-ad403-spk.dts | 55 ++- .../boot/dts/amlogic/a4_a113l2_ba400.dts | 2 +- .../boot/dts/amlogic/a4_a113l2_ba400_sbr.dts | 2 +- .../dts/amlogic/a4_a113l2_ba400_spinand.dts | 78 ++-- .../boot/dts/amlogic/a4_a113l2_ba401.dts | 2 +- .../boot/dts/amlogic/a4_a113l2_ba401_sbr.dts | 2 +- .../boot/dts/amlogic/a4_a113l2_ba409.dts | 78 ++-- arch/arm64/boot/dts/amlogic/a4_pxp.dts | 2 +- .../boot/dts/amlogic/a5_a113x2_av400_1g.dts | 57 ++- .../dts/amlogic/a5_a113x2_av400_1g_spk.dts | 57 ++- .../boot/dts/amlogic/a5_a113x2_av400v2_1g.dts | 57 ++- .../boot/dts/amlogic/a5_a113x2_av409_2g.dts | 57 ++- arch/arm64/boot/dts/amlogic/a5_pxp.dts | 57 ++- .../arm64/boot/dts/amlogic/c2_c305x_af400.dts | 55 ++- arch/arm64/boot/dts/amlogic/meson-a4.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-a5.dtsi | 2 +- .../dts/amlogic/meson-c1-c308x-ae400-nand.dts | 55 ++- .../boot/dts/amlogic/meson-c1-c308x-ae400.dts | 55 ++- .../dts/amlogic/meson-c1-c308x-ae401-nand.dts | 55 ++- .../boot/dts/amlogic/meson-c1-c308x-ae401.dts | 55 ++- .../boot/dts/amlogic/meson-c1-c308x-ae402.dts | 55 ++- .../dts/amlogic/meson-c1-c308x-ae409-nand.dts | 55 ++- .../boot/dts/amlogic/meson-c1-c308x-ae409.dts | 55 ++- arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-s4d.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-s6.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-s7.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-s7d.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-sc2.dtsi | 2 +- arch/arm64/boot/dts/amlogic/mesont6d.dtsi | 2 +- arch/arm64/boot/dts/amlogic/mesont6w.dtsi | 2 +- .../dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts | 2 +- .../boot/dts/amlogic/s4_s905w2_ap201_1g.dts | 2 +- .../boot/dts/amlogic/s4_s905y4_ap222_drm.dts | 2 +- .../amlogic/s4_s905y4_ap222_linux-nand.dts | 2 +- .../dts/amlogic/s4_s905y4_ap222_linux.dts | 2 +- .../boot/dts/amlogic/s4_s905y4_ap223_drm.dts | 2 +- .../boot/dts/amlogic/s4d_s905c3_ap232_drm.dts | 2 +- .../dts/amlogic/s4d_s905c3_ap232_linux.dts | 2 +- .../amlogic/s4d_s905c3_ap232_mxl258c_drm.dts | 2 +- .../boot/dts/amlogic/s4d_s905y4_ap222_drm.dts | 2 +- .../dts/amlogic/s4d_s905y4_ap222_linux.dts | 2 +- .../boot/dts/amlogic/s4d_s905y4_ap223_drm.dts | 2 +- .../dts/amlogic/s4d_s905y4_ap223_linux.dts | 2 +- arch/arm64/boot/dts/amlogic/s6_pxp.dts | 2 +- .../boot/dts/amlogic/s6_s905d5_bq201.dts | 2 +- .../boot/dts/amlogic/s6_s905d5_bq201_16g.dts | 2 +- .../dts/amlogic/s6_s905d5_bq201_linux.dts | 2 +- .../boot/dts/amlogic/s6_s905d5_bq208.dts | 2 +- .../boot/dts/amlogic/s6_s905d5_bq209.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl201.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl201_16g.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl201_2g.dts | 2 +- .../dts/amlogic/s6_s905x5_bl201_linux.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl204.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl204_2g.dts | 2 +- .../dts/amlogic/s6_s905x5_bl204_soundbar.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl204h1.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl204h1_2g.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl207.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl207_2g.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl208.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_bl209.dts | 2 +- .../boot/dts/amlogic/s6_s905x5_raman_ai.dts | 2 +- .../dts/amlogic/s6_s905x5_raman_ai_2g.dts | 2 +- .../dts/amlogic/s6_s905x5_raman_ai_p0.dts | 2 +- .../boot/dts/amlogic/s6_s905x5l_bn201.dts | 2 +- .../dts/amlogic/s6_s905x5l_bn201_linux.dts | 2 +- arch/arm64/boot/dts/amlogic/s7_pxp.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp201_1.5g.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp201_1g.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp201_2g.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp202.dts | 2 +- .../boot/dts/amlogic/s7_s805x3_bp202_1.5g.dts | 2 +- .../boot/dts/amlogic/s7_s905y5_bh201.dts | 2 +- .../dts/amlogic/s7_s905y5_bh201_linux.dts | 2 +- .../boot/dts/amlogic/s7_s905y5_bh202.dts | 2 +- .../boot/dts/amlogic/s7_s905y5_bh209.dts | 2 +- arch/arm64/boot/dts/amlogic/s7d_pxp.dts | 2 +- .../boot/dts/amlogic/s7d_s905a_bm221.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm201.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm201_4g.dts | 2 +- .../dts/amlogic/s7d_s905x5m_bm201_linux.dts | 2 +- .../dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts | 2 +- .../amlogic/s7d_s905x5m_bm201_soundbar.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm202.dts | 2 +- .../dts/amlogic/s7d_s905x5m_bm202_linux.dts | 2 +- .../boot/dts/amlogic/s7d_s905x5m_bm209.dts | 2 +- .../dts/amlogic/sc2_s905c2l_ah221_drm.dts | 57 ++- .../dts/amlogic/sc2_s905x4_ah212_debian.dts | 55 ++- .../boot/dts/amlogic/sc2_s905x4_ah212_drm.dts | 57 ++- .../dts/amlogic/sc2_s905x4_ah212_drm_1.5g.dts | 57 ++- .../dts/amlogic/sc2_s905x4_ah212_drm_1g.dts | 57 ++- .../amlogic/sc2_s905x4_ah212_drm_soundbar.dts | 57 ++- .../dts/amlogic/sc2_s905x4_ah212_linux.dts | 55 ++- .../amlogic/sc2_s905x4_ah212_mxl258c_drm.dts | 57 ++- drivers/mtd/common/Makefile | 2 +- drivers/mtd/common/crypto.c | 418 ++++++++++++++++++ drivers/mtd/common/meson_parse_part.c | 302 +++++++++++++ drivers/mtd/common/nand_bootpart.c | 54 +++ drivers/mtd/nand/Makefile | 2 +- drivers/mtd/nand/meson_nand.c | 39 +- drivers/mtd/spinand/Makefile | 2 +- drivers/mtd/spinand/core.c | 2 +- drivers/mtd/spinand/meson_spinand.c | 299 ++----------- include/linux/amlogic/aml_mtd_nand.h | 1 - include/linux/amlogic/aml_rsv.h | 2 - include/linux/amlogic/aml_spi_nand.h | 1 - include/linux/amlogic/aml_storage.h | 19 + 176 files changed, 2819 insertions(+), 1752 deletions(-) create mode 100644 drivers/mtd/common/crypto.c create mode 100644 drivers/mtd/common/meson_parse_part.c diff --git a/arch/arm/boot/dts/amlogic/a1-a113l-ad403-spk.dts b/arch/arm/boot/dts/amlogic/a1-a113l-ad403-spk.dts index 796eaffca..276dc3197 100644 --- a/arch/arm/boot/dts/amlogic/a1-a113l-ad403-spk.dts +++ b/arch/arm/boot/dts/amlogic/a1-a113l-ad403-spk.dts @@ -742,35 +742,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&partitions>; - partitions: partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x40000>; + + partition@2 { + label = "misc"; + reg = <0x00000000 0x00040000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xc00000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x00c00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4e00000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04e00000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c2_c305x_af400.dts b/arch/arm/boot/dts/amlogic/c2_c305x_af400.dts index 1c7887c23..5b1b50196 100644 --- a/arch/arm/boot/dts/amlogic/c2_c305x_af400.dts +++ b/arch/arm/boot/dts/amlogic/c2_c305x_af400.dts @@ -1000,35 +1000,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_recovery.dts index 508e5e0b8..9cff9b026 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_recovery.dts @@ -1200,55 +1200,69 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00100000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00100000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x800000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x00800000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x00a00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x00a00000>; }; - vendor{ - offset=<0x0 0x0>; - size=<0x0 0x3600000>; + + partition@10 { + label = "vendor"; + reg = <0x00000000 0x03600000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@11 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_spinor_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_spinor_recovery.dts index 28729a919..d23b6c4ce 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_spinor_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_128m_spinor_recovery.dts @@ -1208,55 +1208,69 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00100000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00100000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x800000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x00800000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x00a00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x00a00000>; }; - vendor{ - offset=<0x0 0x0>; - size=<0x0 0x3600000>; + + partition@10 { + label = "vendor"; + reg = <0x00000000 0x03600000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@11 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_recovery.dts index d36b6b2d4..6c0394b7a 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_recovery.dts @@ -1201,55 +1201,69 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00100000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00100000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x800000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x00800000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x00a00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x00a00000>; }; - vendor{ - offset=<0x0 0x0>; - size=<0x0 0x3600000>; + + partition@10 { + label = "vendor"; + reg = <0x00000000 0x03600000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@11 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_spinor_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_spinor_recovery.dts index e496825fa..5c52734db 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_spinor_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw402_256m_spinor_recovery.dts @@ -1209,55 +1209,69 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00100000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00100000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x800000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x00800000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x00a00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x00a00000>; }; - vendor{ - offset=<0x0 0x0>; - size=<0x0 0x3600000>; + + partition@10 { + label = "vendor"; + reg = <0x00000000 0x03600000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@11 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_128m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_128m_recovery.dts index 84f1f237c..b976c711e 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_128m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_128m_recovery.dts @@ -1186,51 +1186,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_256m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_256m_recovery.dts index 96ddd8153..7662c7980 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_256m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw409-emmc_256m_recovery.dts @@ -1186,51 +1186,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_recovery.dts index f6086f666..8ecadb04e 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_recovery.dts @@ -1187,51 +1187,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_spinor_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_spinor_recovery.dts index 16e8aea84..bf467245f 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_spinor_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_128m_spinor_recovery.dts @@ -1195,51 +1195,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_recovery.dts index 1501134f2..17fd6af1f 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_recovery.dts @@ -1187,51 +1187,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_spinor_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_spinor_recovery.dts index 0e22dcaff..6f40c7b8f 100644 --- a/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_spinor_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c302x_aw409_256m_spinor_recovery.dts @@ -1195,51 +1195,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c308l_aw419.dts b/arch/arm/boot/dts/amlogic/c3_c308l_aw419.dts index fddfc62ee..272af7723 100644 --- a/arch/arm/boot/dts/amlogic/c3_c308l_aw419.dts +++ b/arch/arm/boot/dts/amlogic/c3_c308l_aw419.dts @@ -1239,51 +1239,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c308l_aw429_128m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c308l_aw429_128m_recovery.dts index b868aaaa8..6c230a47c 100644 --- a/arch/arm/boot/dts/amlogic/c3_c308l_aw429_128m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c308l_aw429_128m_recovery.dts @@ -1187,51 +1187,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c308l_aw429_256m_recovery.dts b/arch/arm/boot/dts/amlogic/c3_c308l_aw429_256m_recovery.dts index a7874523a..87f395874 100644 --- a/arch/arm/boot/dts/amlogic/c3_c308l_aw429_256m_recovery.dts +++ b/arch/arm/boot/dts/amlogic/c3_c308l_aw429_256m_recovery.dts @@ -1187,51 +1187,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_128m.dtsi b/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_128m.dtsi index e3db1d136..e8c9339fa 100644 --- a/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_128m.dtsi +++ b/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_128m.dtsi @@ -1209,55 +1209,69 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00100000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00100000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x800000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x00800000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x00a00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x00a00000>; }; - vendor{ - offset=<0x0 0x0>; - size=<0x0 0x3600000>; + + partition@10 { + label = "vendor"; + reg = <0x00000000 0x03600000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@11 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_256m.dtsi b/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_256m.dtsi index afb43eab0..53febb762 100644 --- a/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_256m.dtsi +++ b/arch/arm/boot/dts/amlogic/c3_c30xx_aw402_256m.dtsi @@ -1206,55 +1206,69 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00100000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00100000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x800000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x00800000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x00a00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0xA00000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x00a00000>; }; - vendor{ - offset=<0x0 0x0>; - size=<0x0 0x3600000>; + + partition@10 { + label = "vendor"; + reg = <0x00000000 0x03600000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@11 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_128m.dtsi b/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_128m.dtsi index 4929e268c..c4d6aef4f 100644 --- a/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_128m.dtsi +++ b/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_128m.dtsi @@ -1180,51 +1180,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_256m.dtsi b/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_256m.dtsi index 1778bb15c..2286ef8b1 100644 --- a/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_256m.dtsi +++ b/arch/arm/boot/dts/amlogic/c3_c30xx_aw409_256m.dtsi @@ -1196,51 +1196,64 @@ bl_mode = <2>; /* advance mode */ fip_copies = <2>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@6 { + label = "misc"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@8 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x8000000>; + + partition@9 { + label = "system"; + reg = <0x00000000 0x08000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@10 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/c3_pxp.dts b/arch/arm/boot/dts/amlogic/c3_pxp.dts index ade58b5e2..c55032713 100644 --- a/arch/arm/boot/dts/amlogic/c3_pxp.dts +++ b/arch/arm/boot/dts/amlogic/c3_pxp.dts @@ -1096,47 +1096,59 @@ spi-rx-bus-width = <4>; bl_mode = <2>; /* advance mode */ fip_copies = <4>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00000000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00000000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00000000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@6 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@8 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@9 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/meson-s4.dtsi b/arch/arm/boot/dts/amlogic/meson-s4.dtsi index 78daa2d9b..a1f9f8db2 100644 --- a/arch/arm/boot/dts/amlogic/meson-s4.dtsi +++ b/arch/arm/boot/dts/amlogic/meson-s4.dtsi @@ -958,7 +958,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0xfe08c800 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/meson-s4d.dtsi b/arch/arm/boot/dts/amlogic/meson-s4d.dtsi index 0d8ab600a..4d5c2af9f 100644 --- a/arch/arm/boot/dts/amlogic/meson-s4d.dtsi +++ b/arch/arm/boot/dts/amlogic/meson-s4d.dtsi @@ -1462,7 +1462,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0xfe08c800 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/meson-s7.dtsi b/arch/arm/boot/dts/amlogic/meson-s7.dtsi index fe13333cd..36ca9afb7 100644 --- a/arch/arm/boot/dts/amlogic/meson-s7.dtsi +++ b/arch/arm/boot/dts/amlogic/meson-s7.dtsi @@ -885,7 +885,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0xfe08d000 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/meson-s7d.dtsi b/arch/arm/boot/dts/amlogic/meson-s7d.dtsi index 2b5925248..3371aa2c6 100644 --- a/arch/arm/boot/dts/amlogic/meson-s7d.dtsi +++ b/arch/arm/boot/dts/amlogic/meson-s7d.dtsi @@ -900,7 +900,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0xfe08d000 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/meson-sc2.dtsi b/arch/arm/boot/dts/amlogic/meson-sc2.dtsi index fb70a992a..2424201b5 100644 --- a/arch/arm/boot/dts/amlogic/meson-sc2.dtsi +++ b/arch/arm/boot/dts/amlogic/meson-sc2.dtsi @@ -1078,7 +1078,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-full-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-full-ecc"; status = "disabled"; reg = <0xfe08c800 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/mesont6d.dtsi b/arch/arm/boot/dts/amlogic/mesont6d.dtsi index 9a001b3a6..40e048a6f 100644 --- a/arch/arm/boot/dts/amlogic/mesont6d.dtsi +++ b/arch/arm/boot/dts/amlogic/mesont6d.dtsi @@ -892,7 +892,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0xfe08d000 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/mesont6w.dtsi b/arch/arm/boot/dts/amlogic/mesont6w.dtsi index 6744f2d0c..b2c4de36b 100644 --- a/arch/arm/boot/dts/amlogic/mesont6w.dtsi +++ b/arch/arm/boot/dts/amlogic/mesont6w.dtsi @@ -874,7 +874,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0xfe08d000 0x200>; interrupts = ; diff --git a/arch/arm/boot/dts/amlogic/s1a_pxp.dts b/arch/arm/boot/dts/amlogic/s1a_pxp.dts index e1e499e63..223f984b7 100644 --- a/arch/arm/boot/dts/amlogic/s1a_pxp.dts +++ b/arch/arm/boot/dts/amlogic/s1a_pxp.dts @@ -1084,35 +1084,44 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x80000>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00080000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x80000>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00080000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00100000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0xc00000>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00c00000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts b/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts index 2de853b76..3ba09433c 100644 --- a/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts +++ b/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts @@ -1209,7 +1209,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1g.dts b/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1g.dts index 0bcb3acbc..b7f63df26 100644 --- a/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1g.dts +++ b/arch/arm/boot/dts/amlogic/s4_s805x2_aq222_drm_1g.dts @@ -1213,7 +1213,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm.dts b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm.dts index a9c879b49..12a1a9da7 100644 --- a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm.dts +++ b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm.dts @@ -1234,7 +1234,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm_1g.dts b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm_1g.dts index a23e26882..a167c0c84 100644 --- a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm_1g.dts +++ b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_drm_1g.dts @@ -1245,7 +1245,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux.dts b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux.dts index 3ebc17285..f6d111b8e 100644 --- a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux.dts +++ b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux.dts @@ -1238,7 +1238,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux_1g.dts b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux_1g.dts index 5d98b4d59..5b58e591b 100644 --- a/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux_1g.dts +++ b/arch/arm/boot/dts/amlogic/s4_s905y4_ap222_linux_1g.dts @@ -1247,7 +1247,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s805c1a_bf201_256m.dts b/arch/arm/boot/dts/amlogic/s4d_s805c1a_bf201_256m.dts index 3f9c7e576..337a19f06 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s805c1a_bf201_256m.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s805c1a_bf201_256m.dts @@ -907,7 +907,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <2>; fip_size = <0x280000>; bl2ex_2_copies; diff --git a/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_256m.dts b/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_256m.dts index b11e03095..d42097772 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_256m.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_256m.dts @@ -1173,7 +1173,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_512m.dts b/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_512m.dts index e5efad78e..574fe9b9c 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_512m.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s805c3_aq2432_512m.dts @@ -1172,7 +1172,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_256m.dts b/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_256m.dts index 6be892d99..b454931ea 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_256m.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_256m.dts @@ -1164,7 +1164,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_512m.dts b/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_512m.dts index aa212cd8e..821676bd2 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_512m.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s805c3_t215_512m.dts @@ -1163,7 +1163,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_1g_linux.dts b/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_1g_linux.dts index 364411ac7..1b613a20d 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_1g_linux.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_1g_linux.dts @@ -1223,7 +1223,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts b/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts index f5f899077..e9142769c 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts @@ -1223,7 +1223,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts b/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts index 0acdf33f7..e3746d303 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts @@ -1221,7 +1221,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts b/arch/arm/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts index 7936a60e9..022819223 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts @@ -1210,7 +1210,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts b/arch/arm/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts index 22e990bc8..86d699071 100644 --- a/arch/arm/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts +++ b/arch/arm/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts @@ -1203,7 +1203,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_pxp.dts b/arch/arm/boot/dts/amlogic/s7_pxp.dts index 0edb6e223..36d713a4a 100644 --- a/arch/arm/boot/dts/amlogic/s7_pxp.dts +++ b/arch/arm/boot/dts/amlogic/s7_pxp.dts @@ -1346,7 +1346,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_1g.dts b/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_1g.dts index c020aa1f0..baba72e73 100644 --- a/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_1g.dts +++ b/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_1g.dts @@ -939,7 +939,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_1g.dts b/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_1g.dts index b23c451d2..036d18e43 100644 --- a/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_1g.dts +++ b/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_1g.dts @@ -912,7 +912,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_512M.dts b/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_512M.dts index 49e49913d..784155d25 100644 --- a/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_512M.dts +++ b/arch/arm/boot/dts/amlogic/s7_s805x3_bp201_linux_512M.dts @@ -919,7 +919,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s805x3_bp202_1g.dts b/arch/arm/boot/dts/amlogic/s7_s805x3_bp202_1g.dts index ca72d9e6a..3cf294b19 100644 --- a/arch/arm/boot/dts/amlogic/s7_s805x3_bp202_1g.dts +++ b/arch/arm/boot/dts/amlogic/s7_s805x3_bp202_1g.dts @@ -860,7 +860,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s805x3_bp203_linux_512M.dts b/arch/arm/boot/dts/amlogic/s7_s805x3_bp203_linux_512M.dts index 2c717bb1d..a53ea3633 100644 --- a/arch/arm/boot/dts/amlogic/s7_s805x3_bp203_linux_512M.dts +++ b/arch/arm/boot/dts/amlogic/s7_s805x3_bp203_linux_512M.dts @@ -911,7 +911,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s905y5_bh201.dts b/arch/arm/boot/dts/amlogic/s7_s905y5_bh201.dts index 6c77367d9..9582b43cc 100644 --- a/arch/arm/boot/dts/amlogic/s7_s905y5_bh201.dts +++ b/arch/arm/boot/dts/amlogic/s7_s905y5_bh201.dts @@ -907,7 +907,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux.dts b/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux.dts index 3128260d7..aeabfc219 100644 --- a/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux.dts +++ b/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux.dts @@ -917,7 +917,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux_512m.dts b/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux_512m.dts index 689e95fb7..61f415cf3 100644 --- a/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux_512m.dts +++ b/arch/arm/boot/dts/amlogic/s7_s905y5_bh201_linux_512m.dts @@ -921,7 +921,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201.dts b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201.dts index 6a94fcee4..5ce6db81c 100644 --- a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201.dts +++ b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201.dts @@ -911,7 +911,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts index 7b8090e3e..852c9fff6 100644 --- a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts +++ b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts @@ -903,7 +903,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts index b97dff983..77ef01b28 100644 --- a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts +++ b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts @@ -979,7 +979,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm202.dts b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm202.dts index 50ca4077b..f395c2af8 100644 --- a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm202.dts +++ b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm202.dts @@ -764,7 +764,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm209.dts b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm209.dts index e37667af7..2e82792f9 100644 --- a/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm209.dts +++ b/arch/arm/boot/dts/amlogic/s7d_s905x5m_bm209.dts @@ -876,7 +876,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts b/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts index 89680f35b..ad603c0ad 100644 --- a/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts +++ b/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts @@ -1401,35 +1401,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1443,7 +1452,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts b/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts index 2fd1178d5..781fb5d47 100644 --- a/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts +++ b/arch/arm/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts @@ -1399,35 +1399,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1441,7 +1450,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g.dts index 6219a4d58..f55ba2358 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g.dts @@ -772,7 +772,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g_linux.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g_linux.dts index 9e2e4188c..795294080 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g_linux.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1.5g_linux.dts @@ -766,7 +766,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g.dts index fdbf6c91d..e5231f291 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g.dts @@ -772,7 +772,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g_linux.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g_linux.dts index 1dd4bd57b..c31dbe84f 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g_linux.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_1g_linux.dts @@ -760,7 +760,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_512M_linux.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_512M_linux.dts index 3a6b2031b..2565a0c83 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_512M_linux.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br301_512M_linux.dts @@ -745,7 +745,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1.5g.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1.5g.dts index 911770d39..e9fac8d4b 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1.5g.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1.5g.dts @@ -762,7 +762,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1g.dts b/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1g.dts index e1d31e536..586ebd6c3 100644 --- a/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1g.dts +++ b/arch/arm/boot/dts/amlogic/t6d_t950d5_br309_1g.dts @@ -763,7 +763,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/a1-a113l-ad403-spk.dts b/arch/arm64/boot/dts/amlogic/a1-a113l-ad403-spk.dts index 64dcb625e..28c3d6c54 100644 --- a/arch/arm64/boot/dts/amlogic/a1-a113l-ad403-spk.dts +++ b/arch/arm64/boot/dts/amlogic/a1-a113l-ad403-spk.dts @@ -742,35 +742,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&partitions>; - partitions: partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x40000>; + + partition@2 { + label = "misc"; + reg = <0x00000000 0x00040000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0xc00000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x00c00000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4e00000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04e00000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400.dts b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400.dts index a74794643..fc245fdc3 100644 --- a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400.dts +++ b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400.dts @@ -1205,7 +1205,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_sbr.dts b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_sbr.dts index 79304cd21..fe24ce7df 100644 --- a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_sbr.dts +++ b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_sbr.dts @@ -1225,7 +1225,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_spinand.dts b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_spinand.dts index 79f20a8b6..4b29dd60a 100644 --- a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_spinand.dts +++ b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba400_spinand.dts @@ -1205,7 +1205,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; @@ -1313,47 +1313,59 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00200000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x80000>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00080000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x80000>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00080000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00100000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0xc00000>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00c00000>; }; - misc{ - offset=<0x0 0x0>; - size=<0x0 0x40000>; + + partition@5 { + label = "misc"; + reg = <0x00000000 0x00040000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1400000>; + + partition@6 { + label = "recovery"; + reg = <0x00000000 0x01400000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x5000000>; + + partition@8 { + label = "system"; + reg = <0x00000000 0x05000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@9 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401.dts b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401.dts index 51a9e878c..ea30434f0 100644 --- a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401.dts +++ b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401.dts @@ -1192,7 +1192,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401_sbr.dts b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401_sbr.dts index f560df380..c8019afe8 100644 --- a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401_sbr.dts +++ b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba401_sbr.dts @@ -1209,7 +1209,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba409.dts b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba409.dts index 8d570a7a0..05d8a7835 100644 --- a/arch/arm64/boot/dts/amlogic/a4_a113l2_ba409.dts +++ b/arch/arm64/boot/dts/amlogic/a4_a113l2_ba409.dts @@ -1190,7 +1190,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; bl2ex_8_copies; fip_copies = <4>; fip_size = <0x200000>; @@ -1299,47 +1299,59 @@ bl_mode = <2>; /* advance mode */ fip_copies = <4>; info_p_mode = <1>; /* Info page on page 0 */ - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00200000>; }; - bl2e{ - offset=<0x0 0x0>; - size=<0x0 0x80000>; + + partition@1 { + label = "bl2e"; + reg = <0x00000000 0x00080000>; }; - bl2x{ - offset=<0x0 0x0>; - size=<0x0 0x80000>; + + partition@2 { + label = "bl2x"; + reg = <0x00000000 0x00080000>; }; - ddrfip{ - offset=<0x0 0x0>; - size=<0x0 0x100000>; + + partition@3 { + label = "ddrfip"; + reg = <0x00000000 0x00100000>; }; - devfip{ - offset=<0x0 0x0>; - size=<0x0 0xc00000>; + + partition@4 { + label = "devfip"; + reg = <0x00000000 0x00c00000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@5 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@6 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@7 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@8 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@9 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a4_pxp.dts b/arch/arm64/boot/dts/amlogic/a4_pxp.dts index 9c39a37f8..7c6843ea3 100644 --- a/arch/arm64/boot/dts/amlogic/a4_pxp.dts +++ b/arch/arm64/boot/dts/amlogic/a4_pxp.dts @@ -1133,7 +1133,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g.dts b/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g.dts index 588a12715..efc2f621c 100644 --- a/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g.dts +++ b/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g.dts @@ -1108,7 +1108,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; @@ -1215,35 +1215,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g_spk.dts b/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g_spk.dts index 4e81aec08..4483c13ad 100644 --- a/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g_spk.dts +++ b/arch/arm64/boot/dts/amlogic/a5_a113x2_av400_1g_spk.dts @@ -1089,7 +1089,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; @@ -1196,35 +1196,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a5_a113x2_av400v2_1g.dts b/arch/arm64/boot/dts/amlogic/a5_a113x2_av400v2_1g.dts index 19c160dec..9f8da68f8 100644 --- a/arch/arm64/boot/dts/amlogic/a5_a113x2_av400v2_1g.dts +++ b/arch/arm64/boot/dts/amlogic/a5_a113x2_av400v2_1g.dts @@ -1109,7 +1109,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; @@ -1216,35 +1216,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a5_a113x2_av409_2g.dts b/arch/arm64/boot/dts/amlogic/a5_a113x2_av409_2g.dts index 88f565efd..2466ab28a 100644 --- a/arch/arm64/boot/dts/amlogic/a5_a113x2_av409_2g.dts +++ b/arch/arm64/boot/dts/amlogic/a5_a113x2_av409_2g.dts @@ -1135,7 +1135,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; bl2ex_8_copies; fip_copies = <4>; fip_size = <0x200000>; @@ -1243,35 +1243,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/a5_pxp.dts b/arch/arm64/boot/dts/amlogic/a5_pxp.dts index 7674b8765..5a55b89d9 100644 --- a/arch/arm64/boot/dts/amlogic/a5_pxp.dts +++ b/arch/arm64/boot/dts/amlogic/a5_pxp.dts @@ -1173,7 +1173,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; @@ -1262,35 +1262,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/c2_c305x_af400.dts b/arch/arm64/boot/dts/amlogic/c2_c305x_af400.dts index 5a88688b0..b2c87fd56 100644 --- a/arch/arm64/boot/dts/amlogic/c2_c305x_af400.dts +++ b/arch/arm64/boot/dts/amlogic/c2_c305x_af400.dts @@ -1189,35 +1189,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-a4.dtsi b/arch/arm64/boot/dts/amlogic/meson-a4.dtsi index 3c1e4423f..c6a3baf30 100644 --- a/arch/arm64/boot/dts/amlogic/meson-a4.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-a4.dtsi @@ -1119,7 +1119,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08d000 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-a5.dtsi b/arch/arm64/boot/dts/amlogic/meson-a5.dtsi index c2c69ecbd..6ee788cad 100644 --- a/arch/arm64/boot/dts/amlogic/meson-a5.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-a5.dtsi @@ -987,7 +987,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08d000 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400-nand.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400-nand.dts index ad24a4442..40c0f4d77 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400-nand.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400-nand.dts @@ -1276,35 +1276,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400.dts index 7141ebdd6..c236ab2d4 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae400.dts @@ -1219,35 +1219,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401-nand.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401-nand.dts index b221c766f..d258b50b8 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401-nand.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401-nand.dts @@ -1264,35 +1264,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401.dts index 6439ffad8..dd4b1be0e 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae401.dts @@ -1213,35 +1213,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae402.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae402.dts index 440f9b7fe..a53726f7a 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae402.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae402.dts @@ -1256,35 +1256,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409-nand.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409-nand.dts index c3c4be882..b77500324 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409-nand.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409-nand.dts @@ -1254,35 +1254,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409.dts b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409.dts index 73681b080..6355eb0b2 100644 --- a/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409.dts +++ b/arch/arm64/boot/dts/amlogic/meson-c1-c308x-ae409.dts @@ -1203,35 +1203,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&snand_partitions>; - snand_partitions: snand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi index 7185b814d..85043ecd6 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi @@ -962,7 +962,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08c800 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-s4d.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4d.dtsi index 9dad7e8d3..bfe0b29c8 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4d.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s4d.dtsi @@ -1265,7 +1265,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08c800 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-s6.dtsi b/arch/arm64/boot/dts/amlogic/meson-s6.dtsi index 3d4f890d6..39edaf777 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s6.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s6.dtsi @@ -1144,7 +1144,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08c800 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-s7.dtsi b/arch/arm64/boot/dts/amlogic/meson-s7.dtsi index 17595d859..714dae301 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s7.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s7.dtsi @@ -884,7 +884,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08d000 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi b/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi index 03efe1861..82143115c 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi @@ -921,7 +921,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08d000 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/meson-sc2.dtsi b/arch/arm64/boot/dts/amlogic/meson-sc2.dtsi index c94228518..e811b6628 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sc2.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-sc2.dtsi @@ -1079,7 +1079,7 @@ }; mtd_nand: nfc@fe08c800 { - compatible = "amlogic,meson-nfc-full-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-full-ecc"; status = "disabled"; reg = <0x0 0xfe08c800 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/mesont6d.dtsi b/arch/arm64/boot/dts/amlogic/mesont6d.dtsi index ed1b4b78f..9d2d3ad75 100644 --- a/arch/arm64/boot/dts/amlogic/mesont6d.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesont6d.dtsi @@ -892,7 +892,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08d000 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/mesont6w.dtsi b/arch/arm64/boot/dts/amlogic/mesont6w.dtsi index b9ae49736..5d9a791a1 100644 --- a/arch/arm64/boot/dts/amlogic/mesont6w.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesont6w.dtsi @@ -957,7 +957,7 @@ }; mtd_nand: nfc@fe08d000 { - compatible = "amlogic,meson-nfc-single-ecc-bl2ex"; + compatible = "amlogic,meson-nfc-single-ecc"; status = "disabled"; reg = <0x0 0xfe08d000 0x0 0x200>; interrupts = ; diff --git a/arch/arm64/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts b/arch/arm64/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts index 6b9f0f626..1eb17153e 100644 --- a/arch/arm64/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts +++ b/arch/arm64/boot/dts/amlogic/s4_s805x2_aq222_drm_1.5g.dts @@ -1200,7 +1200,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4_s905w2_ap201_1g.dts b/arch/arm64/boot/dts/amlogic/s4_s905w2_ap201_1g.dts index e3f3a25a9..256e2a15f 100644 --- a/arch/arm64/boot/dts/amlogic/s4_s905w2_ap201_1g.dts +++ b/arch/arm64/boot/dts/amlogic/s4_s905w2_ap201_1g.dts @@ -1169,7 +1169,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_drm.dts b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_drm.dts index da2871e0f..274384549 100644 --- a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_drm.dts +++ b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_drm.dts @@ -1223,7 +1223,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux-nand.dts b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux-nand.dts index b12bec7fa..dd6a064d0 100644 --- a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux-nand.dts +++ b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux-nand.dts @@ -1222,7 +1222,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux.dts b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux.dts index 30e3ab8eb..178aabbcd 100644 --- a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_linux.dts @@ -1226,7 +1226,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap223_drm.dts b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap223_drm.dts index 57f7307ae..9cb30c551 100644 --- a/arch/arm64/boot/dts/amlogic/s4_s905y4_ap223_drm.dts +++ b/arch/arm64/boot/dts/amlogic/s4_s905y4_ap223_drm.dts @@ -1193,7 +1193,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts b/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts index 0208cf49c..7bb2aefc5 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_drm.dts @@ -1209,7 +1209,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts b/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts index 3288a8bd4..b820b22b0 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_linux.dts @@ -1207,7 +1207,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_mxl258c_drm.dts b/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_mxl258c_drm.dts index d6a783b5c..c16ae992b 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_mxl258c_drm.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905c3_ap232_mxl258c_drm.dts @@ -1266,7 +1266,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_drm.dts b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_drm.dts index 91958abb3..a1de1b609 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_drm.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_drm.dts @@ -1197,7 +1197,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts index b61970e26..006ec318a 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap222_linux.dts @@ -1197,7 +1197,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_drm.dts b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_drm.dts index 0a69fae1c..82d2d2b7b 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_drm.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_drm.dts @@ -1170,7 +1170,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts index bc098765d..0b35bf01f 100644 --- a/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s4d_s905y4_ap223_linux.dts @@ -1166,7 +1166,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_pxp.dts b/arch/arm64/boot/dts/amlogic/s6_pxp.dts index 89bdfe889..6a506978d 100644 --- a/arch/arm64/boot/dts/amlogic/s6_pxp.dts +++ b/arch/arm64/boot/dts/amlogic/s6_pxp.dts @@ -1035,7 +1035,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201.dts b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201.dts index 833990aad..2e376f220 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201.dts @@ -1025,7 +1025,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_16g.dts b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_16g.dts index 95aed95de..6f9956bdf 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_16g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_16g.dts @@ -1025,7 +1025,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_linux.dts b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_linux.dts index 0517432fc..0bb44b3a4 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq201_linux.dts @@ -1027,7 +1027,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq208.dts b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq208.dts index 969b55e92..7d3abd66b 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq208.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq208.dts @@ -956,7 +956,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq209.dts b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq209.dts index 70c2ff389..d8342e542 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905d5_bq209.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905d5_bq209.dts @@ -981,7 +981,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201.dts index 8904b4a9e..d3fc944cc 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201.dts @@ -990,7 +990,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_16g.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_16g.dts index c145a293a..ef872a1f1 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_16g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_16g.dts @@ -991,7 +991,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_2g.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_2g.dts index 2a37e49ef..7a00c142a 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_2g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_2g.dts @@ -967,7 +967,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_linux.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_linux.dts index 47e4e0c42..8af85fc37 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl201_linux.dts @@ -989,7 +989,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204.dts index 0ba5acb0d..c7ef131b6 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204.dts @@ -981,7 +981,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_2g.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_2g.dts index 6bd7f5ba9..e01afffb6 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_2g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_2g.dts @@ -958,7 +958,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_soundbar.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_soundbar.dts index 4af62be6f..4f9fdcd73 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_soundbar.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204_soundbar.dts @@ -1124,7 +1124,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1.dts index 7b67cfb8f..fff62c67f 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1.dts @@ -981,7 +981,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1_2g.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1_2g.dts index 9cc9c94ee..0afa92c78 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1_2g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl204h1_2g.dts @@ -958,7 +958,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207.dts index a9d4492df..38cd3a96a 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207.dts @@ -979,7 +979,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207_2g.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207_2g.dts index 97446ac5d..55dc83ee5 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207_2g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl207_2g.dts @@ -967,7 +967,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl208.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl208.dts index ab6b34681..f839a1bac 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl208.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl208.dts @@ -974,7 +974,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl209.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl209.dts index 0e3fb9b74..cee7d43d6 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_bl209.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_bl209.dts @@ -948,7 +948,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai.dts index 1289ef5a0..4f84e7b28 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai.dts @@ -1190,7 +1190,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_2g.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_2g.dts index c1f394206..5b7955c40 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_2g.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_2g.dts @@ -1049,7 +1049,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_p0.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_p0.dts index 78348d24b..5726621d9 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_p0.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5_raman_ai_p0.dts @@ -1024,7 +1024,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201.dts index 391657854..9e63c16e0 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201.dts @@ -997,7 +997,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201_linux.dts b/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201_linux.dts index eb681dff4..53022f3bd 100644 --- a/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s6_s905x5l_bn201_linux.dts @@ -989,7 +989,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_pxp.dts b/arch/arm64/boot/dts/amlogic/s7_pxp.dts index 55dde76e7..62bcc8e6b 100644 --- a/arch/arm64/boot/dts/amlogic/s7_pxp.dts +++ b/arch/arm64/boot/dts/amlogic/s7_pxp.dts @@ -952,7 +952,7 @@ pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; bl2ex_8_copies; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <2>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1.5g.dts b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1.5g.dts index 0e3db9838..0d0a72226 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1.5g.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1.5g.dts @@ -913,7 +913,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1g.dts b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1g.dts index 85a112871..d97804e5f 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1g.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_1g.dts @@ -919,7 +919,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_2g.dts b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_2g.dts index 77dc40038..b4c4980de 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_2g.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp201_2g.dts @@ -902,7 +902,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202.dts b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202.dts index 252f3f011..751f0efe6 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202.dts @@ -822,7 +822,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202_1.5g.dts b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202_1.5g.dts index 0a0856e5c..988b0045f 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202_1.5g.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s805x3_bp202_1.5g.dts @@ -834,7 +834,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201.dts b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201.dts index 7411032d7..2ebb8b578 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201.dts @@ -896,7 +896,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201_linux.dts b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201_linux.dts index 48a89106b..a78ef3e08 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh201_linux.dts @@ -929,7 +929,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh202.dts b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh202.dts index 99d5d5a7e..ed554a9d8 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh202.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh202.dts @@ -807,7 +807,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh209.dts b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh209.dts index e3ba454aa..ffe9a1fd8 100644 --- a/arch/arm64/boot/dts/amlogic/s7_s905y5_bh209.dts +++ b/arch/arm64/boot/dts/amlogic/s7_s905y5_bh209.dts @@ -892,7 +892,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_pxp.dts b/arch/arm64/boot/dts/amlogic/s7d_pxp.dts index 3c4cc3121..15e5036f1 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_pxp.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_pxp.dts @@ -954,7 +954,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905a_bm221.dts b/arch/arm64/boot/dts/amlogic/s7d_s905a_bm221.dts index 9313ed3c1..dc61f27e1 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905a_bm221.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905a_bm221.dts @@ -888,7 +888,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201.dts index acce255ae..c4f481179 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201.dts @@ -888,7 +888,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_4g.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_4g.dts index e08f7bbfb..b25937801 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_4g.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_4g.dts @@ -888,7 +888,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts index 2ca16106c..24c93a00f 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_linux.dts @@ -895,7 +895,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts index 5cd3b94a3..1746d1f1f 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_mxl258c.dts @@ -957,7 +957,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_soundbar.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_soundbar.dts index 1630f9a8e..785a468ed 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_soundbar.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm201_soundbar.dts @@ -1065,7 +1065,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202.dts index 3ecb22dd6..d9a15096c 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202.dts @@ -746,7 +746,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202_linux.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202_linux.dts index 5489c8de6..fd5a23250 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202_linux.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm202_linux.dts @@ -746,7 +746,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm209.dts b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm209.dts index 810e47b35..72d0b9ab3 100644 --- a/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm209.dts +++ b/arch/arm64/boot/dts/amlogic/s7d_s905x5m_bm209.dts @@ -856,7 +856,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905c2l_ah221_drm.dts b/arch/arm64/boot/dts/amlogic/sc2_s905c2l_ah221_drm.dts index 4a943d591..8bed4b84e 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905c2l_ah221_drm.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905c2l_ah221_drm.dts @@ -1406,35 +1406,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1448,7 +1457,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_debian.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_debian.dts index e4e67c289..f80c02095 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_debian.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_debian.dts @@ -1373,35 +1373,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts index 6cc7fea11..d099bf048 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm.dts @@ -1389,35 +1389,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1431,7 +1440,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1.5g.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1.5g.dts index e206befa8..9d89761d1 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1.5g.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1.5g.dts @@ -1389,35 +1389,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1431,7 +1440,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts index d96c4f4ce..7e6c4f4f1 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_1g.dts @@ -1415,35 +1415,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1457,7 +1466,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_soundbar.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_soundbar.dts index d63617d07..2c9cdcecd 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_soundbar.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_drm_soundbar.dts @@ -1514,35 +1514,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1556,7 +1565,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_linux.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_linux.dts index 3f99c3ab9..4d65b7169 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_linux.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_linux.dts @@ -1323,35 +1323,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; diff --git a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_mxl258c_drm.dts b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_mxl258c_drm.dts index 533225199..483cad0a1 100644 --- a/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_mxl258c_drm.dts +++ b/arch/arm64/boot/dts/amlogic/sc2_s905x4_ah212_mxl258c_drm.dts @@ -1486,35 +1486,44 @@ bl_mode = <1>; fip_copies = <4>; fip_size = <0x200000>; - partition = <&spinand_partitions>; - spinand_partitions: spinand_partitions{ - bootloader{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x00000000 0x00000000>; }; - tpl{ - offset=<0x0 0x0>; - size=<0x0 0x0>; + + partition@1 { + label = "tpl"; + reg = <0x00000000 0x00000000>; }; - logo{ - offset=<0x0 0x0>; - size=<0x0 0x200000>; + + partition@2 { + label = "logo"; + reg = <0x00000000 0x00200000>; }; - recovery{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@3 { + label = "recovery"; + reg = <0x00000000 0x01000000>; }; - boot{ - offset=<0x0 0x0>; - size=<0x0 0x1000000>; + + partition@4 { + label = "boot"; + reg = <0x00000000 0x01000000>; }; - system{ - offset=<0x0 0x0>; - size=<0x0 0x4000000>; + + partition@5 { + label = "system"; + reg = <0x00000000 0x04000000>; }; - data{ - offset=<0xffffffff 0xffffffff>; - size=<0x0 0x0>; + + partition@6 { + label = "data"; + reg = <0x00000000 0xffffffff>; }; }; }; @@ -1528,7 +1537,7 @@ pinctrl-names = "nand_norb_mod","nand_cs_only"; pinctrl-0 = <&all_nand_pins>; pinctrl-1 = <&nand_cs_pins>; - bl_mode = <1>; + bl_mode = <2>; fip_copies = <4>; fip_size = <0x200000>; ship_bad_block = <1>; diff --git a/drivers/mtd/common/Makefile b/drivers/mtd/common/Makefile index ef3e3f603..4c2ac9fc1 100644 --- a/drivers/mtd/common/Makefile +++ b/drivers/mtd/common/Makefile @@ -3,7 +3,7 @@ MODULE_NAME = amlogic-mtd-common obj-$(CONFIG_AMLOGIC_MTD_COMMON) = $(MODULE_NAME).o $(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_RESV) += reserve/rsv-manage.o reserve/rsv-dev.o reserve/rsv-key.o -$(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_COMMON) += nand_bootpart.o page_info.o +$(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_COMMON) += nand_bootpart.o page_info.o meson_parse_part.o crypto.o PR_FMT = $(subst amlogic-,,$(MODULE_NAME)) PR_FMT_DEFINE="-Dpr_fmt(fmt)= \"[$(PR_FMT)]: \" fmt" diff --git a/drivers/mtd/common/crypto.c b/drivers/mtd/common/crypto.c new file mode 100644 index 000000000..5e78284ce --- /dev/null +++ b/drivers/mtd/common/crypto.c @@ -0,0 +1,418 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 Amlogic, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +int encrypt_part_num; +struct encrypt_partition encrypt_part[MAX_ENCRYPT_PARTITIONS] = {0}; + +/* nand crypto mutex */ +DEFINE_MUTEX(nand_crypto_mutex); +static unsigned char iv[CRYPT_BLOCK_SIZE]; + +static int get_encrypted_part_from_dts(const char *part_name) +{ + struct property *prop; + struct device_node *keys; + int ret; + + keys = of_find_node_by_name(NULL, "keys"); + if (!keys) { + pr_err("can't find keys node\n"); + return -1; + } + + prop = of_find_property(keys, part_name, &ret); + if (!prop) + return -1; + + return 0; +} + +static int get_key_from_dts(unsigned char *key, const char *part_name) +{ + struct property *prop; + struct device_node *keys; + unsigned int tmp[4]; + int ret; + + keys = of_find_node_by_name(NULL, "keys"); + if (!keys) { + pr_err("can't find keys node\n"); + return -1; + } + ret = of_property_read_u32_array(keys, part_name, + tmp, 4); + if (ret) { + pr_info("read %s key failed\n", part_name); + return ret; + } + + tmp[0] = cpu_to_be32(tmp[0]); + tmp[1] = cpu_to_be32(tmp[1]); + tmp[2] = cpu_to_be32(tmp[2]); + tmp[3] = cpu_to_be32(tmp[3]); + memcpy(key, tmp, CRYPT_BLOCK_SIZE); + + prop = of_find_property(keys, part_name, &ret); + if (!prop) { + pr_err("%s key not found, unable to remove\n", part_name); + } else { + if (of_remove_property(keys, prop)) + pr_warn("failed to remove %s key\n", part_name); + } + + return 0; +} + +static unsigned char *get_nand_key(struct encrypt_partition *encrypt_region, + const char *part_name) +{ + struct encrypt_partition *encrypt_region_start = encrypt_part; + int i, j; + + if (encrypt_region->have_nand_key) + return encrypt_region->key; + + if (!get_key_from_dts(encrypt_region->key, part_name)) + encrypt_region->have_nand_key = 1; + else + return NULL; + + for (i = 0; i < MAX_ENCRYPT_PARTITIONS; i++, encrypt_region_start++) { + if (!encrypt_region_start->offset || + !encrypt_region_start->size) + continue; + + if (!encrypt_region->have_nand_key) + continue; + + for (j = 0; j < CRYPT_BLOCK_SIZE; j++) + if (encrypt_region_start->key[j] != encrypt_region->key[j]) + break; + + WARN_ON(j == CRYPT_BLOCK_SIZE); + } + + return encrypt_region->key; +} + +static unsigned char *get_nand_key_hash(struct encrypt_partition *encrypt_region) +{ + struct shash_desc *desc = 0; + int descsize; + struct crypto_shash *hash; + + if (encrypt_region->have_nand_key_hash) + return encrypt_region->nand_key_hash; + + hash = crypto_alloc_shash("md5", 0, CRYPTO_ALG_ASYNC); + if (IS_ERR(hash)) + return NULL; + + if (crypto_shash_digestsize(hash) > CRYPT_BLOCK_SIZE) + return NULL; + + descsize = sizeof(struct shash_desc) + crypto_shash_descsize(hash); + desc = kzalloc(descsize, GFP_KERNEL); + if (!desc) + return NULL; + + desc->tfm = hash; + crypto_shash_init(desc); + crypto_shash_digest(desc, encrypt_region->key, + CRYPT_BLOCK_SIZE, encrypt_region->nand_key_hash); + crypto_free_shash(hash); + kfree(desc); + encrypt_region->have_nand_key_hash = 1; + + return encrypt_region->nand_key_hash; +} + +enum crypttype { + ENCRYPT, + DECRYPT +}; + +static int nand_crypt(enum crypttype crypt_type, + struct crypto_skcipher *pcipher, + const u8 *data, const u8 *dst, unsigned int data_size, + const u8 *iv) +{ + struct skcipher_request *req = NULL; + struct scatterlist sg, sg_dst, *d = &sg; + DECLARE_CRYPTO_WAIT(wait); + int result; + + /* Allocate a request object */ + req = skcipher_request_alloc(pcipher, GFP_KERNEL); + if (!req) + return -ENOMEM; + + sg_init_one(&sg, data, data_size); + if (data != dst) { + sg_init_one(&sg_dst, dst, data_size); + d = &sg_dst; + } + + skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG | + CRYPTO_TFM_REQ_MAY_SLEEP, + crypto_req_done, &wait); + skcipher_request_set_crypt(req, &sg, + d, data_size, (void *)iv); + + if (crypt_type == ENCRYPT) + result = crypto_wait_req(crypto_skcipher_encrypt(req), &wait); + else + result = crypto_wait_req(crypto_skcipher_decrypt(req), &wait); + if (result) + pr_err("Error encrypting data: %d\n", result); + + skcipher_request_free(req); + + return result; +} + +int get_iv_fator(struct encrypt_partition *encrypt_region, + int page, int pagesize) +{ + int i, lpn, temp; + + if (!encrypt_region->map) + return page; + + temp = page & (~((1 << encrypt_region->shift) - 1)); + if ((u16)temp > encrypt_region->map[encrypt_region->map_len - 1]) + return -1; + + for (i = 0; i < encrypt_region->map_len; i++) + if ((u16)temp < encrypt_region->map[i]) + break; + + lpn = (i - 1) << encrypt_region->shift; + lpn += (page & ((1 << encrypt_region->shift) - 1)); + + return IV_FACTOR_BASE_ADDR + lpn * (pagesize >> 9); +} + +void nand_decrypt_page(struct encrypt_partition *encrypt_region, + unsigned int pagesize, unsigned char *buf, int page) +{ + int s, i = pagesize >> 9, lbn; + + might_sleep(); + + lbn = get_iv_fator(encrypt_region, page, pagesize); + WARN_ON(lbn < 0); + while (i--) { + u8 iv_iv[16] = {0xff}; + + /* First set iv = page number. */ + iv[0] = lbn & 0xFF; + iv[1] = (lbn >> 8) & 0xFF; + iv[2] = (lbn >> 16) & 0xFF; + iv[3] = (lbn >> 24) & 0xFF; + memset(&iv[4], 0, CRYPT_BLOCK_SIZE - 4); + nand_crypt(ENCRYPT, encrypt_region->iv_cipher, + iv, iv, CRYPT_BLOCK_SIZE, iv_iv); + s = nand_crypt(DECRYPT, encrypt_region->nand_cipher, + buf, buf, 512, iv); + /* TODO: understand failure modes of nand_crypt */ + WARN_ON(s < 0); + lbn += 1; + buf += 512; + } +} +EXPORT_SYMBOL_GPL(nand_decrypt_page); + +bool nand_encrypt_page(struct encrypt_partition *encrypt_region, + unsigned int pagesize, + const unsigned char *buf, int page) +{ + unsigned char *new_buf, *new_temp_buf, *tmp_buf = (unsigned char *)buf; + int s, lbn, i = pagesize >> 9; + + might_sleep(); + + new_buf = kmalloc(pagesize, GFP_KERNEL); + if (WARN_ON_ONCE(!new_buf)) + return NULL; + + lbn = get_iv_fator(encrypt_region, page, pagesize); + WARN_ON(lbn < 0); + + new_temp_buf = new_buf; + while (i--) { + u8 iv_iv[16] = {0xff}; + + /* First set iv = page number. */ + iv[0] = lbn & 0xFF; + iv[1] = (lbn >> 8) & 0xFF; + iv[2] = (lbn >> 16) & 0xFF; + iv[3] = (lbn >> 24) & 0xFF; + memset(&iv[4], 0, CRYPT_BLOCK_SIZE - 4); + nand_crypt(ENCRYPT, encrypt_region->iv_cipher, + iv, iv, CRYPT_BLOCK_SIZE, iv_iv); + s = nand_crypt(ENCRYPT, encrypt_region->nand_cipher, + tmp_buf, new_temp_buf, 512, iv); + /* + * TODO: understand failure modes of nand_crypt. + * This probably ought to be BUG_ON + */ + if (WARN_ON_ONCE(s < 0)) + return false; + + lbn += 1; + tmp_buf += 512; + new_temp_buf += 512; + } + + memcpy((void *)buf, new_buf, pagesize); + kfree(new_buf); + + return true; +} +EXPORT_SYMBOL_GPL(nand_encrypt_page); + +int get_cipher(struct crypto_skcipher **p_cipher, const unsigned char *key) +{ + int result; + + if (!key) + return -1; + + *p_cipher = crypto_alloc_skcipher("cbc(aes)", 0, 0); + if (IS_ERR(*p_cipher)) { + result = PTR_ERR(*p_cipher); + *p_cipher = NULL; + return result; + } + + return crypto_skcipher_setkey(*p_cipher, + key, + CRYPT_BLOCK_SIZE); +} + +struct encrypt_partition *is_need_encrypted(unsigned long addr) +{ + struct encrypt_partition *encrypt_region = encrypt_part; + int i; + + /* + * each partition can be in either encrypted state or + * unencrypted state, but can't be in both encrypted + * and unencrypted state, so simply loop for looking + * whether the page is in the encrypted region or not. + */ + for (i = 0; i < MAX_ENCRYPT_PARTITIONS; i++, encrypt_region++) { + if (!encrypt_region->offset || !encrypt_region->size) + continue; + + if (addr >= encrypt_region->offset && + addr < encrypt_region->offset + encrypt_region->size) + return encrypt_region; + } + + return NULL; +} +EXPORT_SYMBOL_GPL(is_need_encrypted); + +int set_region_encrypted(struct mtd_info *mtd, + struct mtd_partition *part, + bool need_map) +{ + struct encrypt_partition *encrypt_region = encrypt_part; + int i, ret; + + if (encrypt_part_num >= MAX_ENCRYPT_PARTITIONS) + return -1; + + ret = get_encrypted_part_from_dts(part->name); + if (ret) + return -1; + + for (i = 0; i < MAX_ENCRYPT_PARTITIONS; i++, encrypt_region++) + if (encrypt_region->offset == part->offset && + encrypt_region->size == part->size) + return 0; + + encrypt_region = encrypt_part; + for (i = 0; i < MAX_ENCRYPT_PARTITIONS; i++, encrypt_region++) { + int result, map_size; + + if (encrypt_region->offset || encrypt_region->size) + continue; + + result = get_cipher(&encrypt_region->nand_cipher, + get_nand_key(encrypt_region, part->name)); + if (result < 0) + return -1; + + result = get_cipher(&encrypt_region->iv_cipher, + get_nand_key_hash(encrypt_region)); + if (result < 0) + return -1; + + if (need_map) { + loff_t offset = part->offset; + loff_t end = part->offset + part->size; + int j = 0; + + map_size = part->size >> mtd->erasesize_shift; + encrypt_region->map = kmalloc(map_size << 1, GFP_KERNEL); + while (offset < end) { + if (!mtd->_block_isbad(mtd, offset)) + encrypt_region->map[j++] = + offset >> mtd->writesize_shift; + offset += mtd->erasesize; + } + encrypt_region->map_len = j; + encrypt_region->shift = mtd->erasesize_shift - + mtd->writesize_shift; + } + encrypt_region->offset = part->offset; + encrypt_region->size = part->size; + pr_debug("encrypted region: %llx %llx\n", part->offset, part->size); + encrypt_part_num++; + return 0; + } + + return -1; +} +EXPORT_SYMBOL_GPL(set_region_encrypted); + +int disable_region_encrypted(struct mtd_partition *part) +{ + struct encrypt_partition *encrypt_region = encrypt_part; + int i; + + if (encrypt_part_num == 0) + return 0; + + for (i = 0; i < MAX_ENCRYPT_PARTITIONS; i++, encrypt_region++) { + if (encrypt_region->offset == part->offset && + encrypt_region->size == part->size) { + encrypt_region->offset = 0; + encrypt_region->size = 0; + encrypt_region->nand_cipher = NULL; + encrypt_region->iv_cipher = NULL; + kfree(encrypt_region->map); + pr_debug("unencrypted region<-: %llx %llx\n", + part->offset, part->size); + encrypt_part_num--; + return 0; + } + } + + return -1; +} +EXPORT_SYMBOL_GPL(disable_region_encrypted); diff --git a/drivers/mtd/common/meson_parse_part.c b/drivers/mtd/common/meson_parse_part.c new file mode 100644 index 000000000..bb43bb245 --- /dev/null +++ b/drivers/mtd/common/meson_parse_part.c @@ -0,0 +1,302 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 Amlogic, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static u32 skip_bad_block; + +static bool node_has_compatible(struct device_node *pp) +{ + return of_get_property(pp, "compatible", NULL); +} + +void meson_nand_set_skip_bad_block(u32 skip) +{ + if (skip_bad_block) + pr_warn("WARNING !!! skip_bad_block %d would overwrite to %d\n", + skip_bad_block, skip); + skip_bad_block = skip; +} +EXPORT_SYMBOL_GPL(meson_nand_set_skip_bad_block); + +static int meson_nand_partition_relocate(struct mtd_info *master, u8 nr_parts, + struct mtd_partition *parts) +{ + u8 i = 0, bl_mode; + loff_t reserved_part_blk_num = meson_rsv_get_block_cnt(); + u64 part_size, start_blk = 0, part_blk = 0; + loff_t offset; + int phys_erase_shift; + loff_t adjust_offset = 0; + struct mtd_partition *part = parts; + + if (!strncmp((char *)part->name, NAND_BOOT_NAME, + strlen((const char *)NAND_BOOT_NAME)) || + !strcmp((char *)part->name, "bl2")) { + part->offset = 0; + if (!part->size) + part->size = ((uint64_t)master->writesize * BOOT_TOTAL_PAGES); + part++; + nr_parts -= 1; + } + + if (!nr_parts) + goto out; + + phys_erase_shift = ffs(master->erasesize) - 1; + + adjust_offset = BOOT_TOTAL_PAGES * (loff_t)master->writesize; + bl_mode = meson_nand_get_bootloader_mode(); + if (bl_mode == NAND_FIPMODE_ADVANCE) { + /* get boot area entry form env */ + aml_nand_param_check_and_layout_init(master); + /* bl2e, bl2x, ddrfip, devfip */ + for (i = BOOT_AREA_BL2E; i < BOOT_AREA_DEVFIP; i++) { + part->offset = + g_ssp.boot_entry[i].offset; + part->size = (uint64_t)g_ssp.boot_entry[i].size * + g_ssp.boot_backups; + part++; + } + part->offset = g_ssp.boot_entry[BOOT_AREA_DEVFIP].offset; + part->size = g_ssp.boot_entry[BOOT_AREA_DEVFIP].size * + meson_nand_get_fipcopies(); + nr_parts -= 4; + } else if (bl_mode == NAND_FIPMODE_DISCRETE) { + /* tpl, which not skip bad block, support NAND_FIPMODE_DISCRETE only */ + part->offset = adjust_offset + + reserved_part_blk_num * + master->erasesize; + part->size = meson_nand_get_fipsize() * meson_nand_get_fipcopies(); + nr_parts -= 1; + } else { + pr_err("%s: Invalid bootloader mode\n", __func__); + return -EINVAL; + }; + + adjust_offset = part->offset + part->size; + part++; + + while (--nr_parts) { + if (master->size < adjust_offset) { + pr_err("%s %d error: over the nand size!!!\n", + __func__, __LINE__); + return -EINVAL; + } + part->offset = adjust_offset; + part_size = part->size; + + if (skip_bad_block) { + offset = 0; + start_blk = 0; + part_blk = part_size >> phys_erase_shift; + do { + offset = adjust_offset + start_blk * + master->erasesize; + if (master->_block_isbad(master, offset) == NAND_FACTORY_BAD) { + pr_info("%s %d factory bad addr=%llx\n", + __func__, __LINE__, (u64)(offset >> + phys_erase_shift)); + adjust_offset += master->erasesize; + continue; + } + start_blk++; + } while (start_blk < part_blk); + } + adjust_offset += part_size; + part->size = adjust_offset - part->offset; + part++; + } + + /* last partition */ + part->offset = adjust_offset; + part->size = master->size - part->offset; +out: + return 0; +} + +static int meson_parse_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +{ + struct mtd_partition *parts; + struct device_node *mtd_node; + struct device_node *ofpart_node; + const char *partname; + struct device_node *pp; + u8 nr_parts, i; + int ret = 0; + bool dedicated = true; + + /* Pull of_node from the master device node */ + mtd_node = mtd_get_of_node(master); + if (!mtd_node) + return 0; + + ofpart_node = of_get_child_by_name(mtd_node, "partitions"); + if (!ofpart_node) { + /* + * We might get here even when ofpart isn't used at all (e.g., + * when using another parser), so don't be louder than + * KERN_DEBUG + */ + pr_debug("%s: 'partitions' subnode not found on %pOF. Trying to parse direct subnodes as partitions.\n", + master->name, mtd_node); + ofpart_node = mtd_node; + dedicated = false; + } + + /* First count the subnodes */ + nr_parts = 0; + for_each_child_of_node(ofpart_node, pp) { + if (!dedicated && node_has_compatible(pp)) + continue; + + nr_parts++; + } + + if (nr_parts == 0) { + pr_err("%s: not found partitions on %pOF.\n", __func__, ofpart_node); + return 0; + } + + parts = kcalloc(nr_parts, sizeof(*parts), GFP_KERNEL); + if (!parts) + return -ENOMEM; + i = 0; + for_each_child_of_node(ofpart_node, pp) { + const __be32 *reg; + int len; + int a_cells, s_cells; + + if (!dedicated && node_has_compatible(pp)) + continue; + + reg = of_get_property(pp, "reg", &len); + if (!reg) { + if (dedicated) { + pr_err("%s: ofpart partition %pOF (%pOF) missing reg property.\n", + master->name, pp, + mtd_node); + goto part_fail; + } else { + nr_parts--; + continue; + } + } + + a_cells = of_n_addr_cells(pp); + s_cells = of_n_size_cells(pp); + if (len / 4 != a_cells + s_cells) { + pr_err("%s: ofpart partition %pOF (%pOF) error parsing reg property.\n", + master->name, pp, + mtd_node); + goto part_fail; + } + + parts[i].offset = of_read_number(reg, a_cells); + parts[i].size = of_read_number(reg + a_cells, s_cells); + parts[i].of_node = pp; + + partname = of_get_property(pp, "label", &len); + if (!partname) + partname = of_get_property(pp, "name", &len); + parts[i].name = partname; + + pr_debug("%s: size %llx\n", parts[i].name, parts[i].size); + if (of_get_property(pp, "read-only", &len)) + parts[i].mask_flags |= MTD_WRITEABLE; + + if (of_get_property(pp, "lock", &len)) + parts[i].mask_flags |= MTD_POWERUP_LOCK; + + if (of_property_read_bool(pp, "slc-mode")) + parts[i].add_flags |= MTD_SLC_ON_MLC_EMULATION; + + i++; + } + + if (!nr_parts) + goto part_none; + + ret = meson_nand_partition_relocate(master, nr_parts, parts); + if (ret) + goto part_none; + + *pparts = parts; + return nr_parts; + +part_fail: + pr_err("%s: error parsing ofpart partition %pOF (%pOF)\n", + master->name, pp, mtd_node); + ret = -EINVAL; +part_none: + of_node_put(pp); + kfree(parts); + return ret; +} + +static const char * const meson_mtd_types[] = { + "cmdlinepart", + "meson_ofpartitions", + NULL +}; + +struct mtd_part_parser meson_parts_parser = { + .parse_fn = meson_parse_partitions, + .name = "meson_ofpartitions", +}; + +#ifdef CONFIG_NAND_ENCRYPTION +static void mtd_loop_encrypted_partition(struct mtd_info *mtd) +{ + struct mtd_info *child, *master = mtd_get_master(mtd); + struct mtd_partition part, *ppart; + + ppart = ∂ + mutex_lock(&master->master.partitions_lock); + list_for_each_entry(child, &mtd->partitions, part.node) { + ppart->offset = child->part.offset; + ppart->size = child->part.size; + ppart->name = child->name; + set_region_encrypted(mtd, ppart, true); + } + mutex_unlock(&master->master.partitions_lock); +} +#endif + +static void meson_nand_register_mtd_parser(void) +{ + static bool had_register; + + if (had_register) + return; + + register_mtd_parser(&meson_parts_parser); + had_register = true; +} + +int meson_add_mtd_partitions(struct mtd_info *mtd) +{ + meson_nand_register_mtd_parser(); + if (mtd_device_parse_register(mtd, meson_mtd_types, NULL, NULL, 0) != 0) { + pr_err("%s() register partitions failed\n", __func__); + return -1; + } + +#ifdef CONFIG_NAND_ENCRYPTION + mtd_loop_encrypted_partition(mtd); +#endif + return 0; +} +EXPORT_SYMBOL_GPL(meson_add_mtd_partitions); diff --git a/drivers/mtd/common/nand_bootpart.c b/drivers/mtd/common/nand_bootpart.c index 025f1c518..a6f6dcb2a 100644 --- a/drivers/mtd/common/nand_bootpart.c +++ b/drivers/mtd/common/nand_bootpart.c @@ -10,6 +10,9 @@ #include #include +static u32 fipsize; +static u32 fipcopies; +static u32 bootloader_mode; static char *cmdline; static char *rsv_cmdline; struct storage_startup_parameter g_ssp; @@ -156,6 +159,57 @@ int aml_nand_param_check_and_layout_init(struct mtd_info *mtd) } EXPORT_SYMBOL_GPL(aml_nand_param_check_and_layout_init); +void meson_nand_set_fipsize(u32 fip_size) +{ + if (fipsize) + pr_warn("WARNING !!! fip size %x would overwrite to 0x%x\n", + fipsize, fip_size); + fipsize = fip_size; + + pr_info("fipsize 0x%x\n", fipsize); +} +EXPORT_SYMBOL_GPL(meson_nand_set_fipsize); + +u32 meson_nand_get_fipsize(void) +{ + return fipsize; +} +EXPORT_SYMBOL_GPL(meson_nand_get_fipsize); + +void meson_nand_set_fipcopies(u32 fip_copies) +{ + if (fipcopies) + pr_warn("WARNING !!! fip copies %d would overwrite to %d\n", + fipcopies, fip_copies); + fipcopies = fip_copies; + + pr_info("fipcopies 0x%x\n", fipcopies); +} +EXPORT_SYMBOL_GPL(meson_nand_set_fipcopies); + +u32 meson_nand_get_fipcopies(void) +{ + return fipcopies; +} +EXPORT_SYMBOL_GPL(meson_nand_get_fipcopies); + +void meson_nand_set_bootloader_mode(u32 bl_mode) +{ + if (bootloader_mode) + pr_warn("WARNING !!! bl mode %d would overwrite to %d\n", + bootloader_mode, bl_mode); + bootloader_mode = bl_mode; + + pr_info("bootloader_mode 0x%x\n", bootloader_mode); +} +EXPORT_SYMBOL_GPL(meson_nand_set_bootloader_mode); + +u32 meson_nand_get_bootloader_mode(void) +{ + return bootloader_mode; +} +EXPORT_SYMBOL_GPL(meson_nand_get_bootloader_mode); + char *aml_nand_get_rsv_cmdline(void) { return rsv_cmdline; diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index 6a6dea799..7f7a209e7 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -2,7 +2,7 @@ MODULE_NAME = amlogic_mtd_nfc obj-$(CONFIG_AMLOGIC_MTD_NAND) = $(MODULE_NAME).o -$(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_NAND) += meson_nand.o meson_parse_part.o nand_flash_id.o +$(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_NAND) += meson_nand.o nand_flash_id.o PR_FMT = $(subst amlogic-,,$(MODULE_NAME)) PR_FMT_DEFINE="-Dpr_fmt(fmt)= \"[$(PR_FMT)]: \" fmt" diff --git a/drivers/mtd/nand/meson_nand.c b/drivers/mtd/nand/meson_nand.c index b4bc4fa08..c32046add 100644 --- a/drivers/mtd/nand/meson_nand.c +++ b/drivers/mtd/nand/meson_nand.c @@ -1710,11 +1710,6 @@ int meson_nand_block_markbad(struct mtd_info *mtd, loff_t offs) return ret; } -static const char * const meson_types[] = { - "meson-partitions", - NULL -}; - static int meson_choose_interface_config(struct nand_chip *chip, struct nand_interface_config *iface) { @@ -1834,14 +1829,10 @@ meson_nfc_nand_chip_init(struct device *dev, } } - if (mtd_device_parse_register(mtd, meson_types, NULL, NULL, 0) < 0) { - /* default_mtd_part_types to parse register */ - mtd->name = "aml-mtd"; - if (mtd_device_parse_register(mtd, NULL, NULL, NULL, 0)) { - dev_err(dev, "failed to register MTD device: %d\n", ret); - nand_cleanup(nand); - return ret; - } + if (meson_add_mtd_partitions(mtd)) { + dev_err(dev, "failed to register MTD device: %d\n", ret); + nand_cleanup(nand); + return ret; } if (aml_mtd_devnum == 0) { @@ -1974,6 +1965,11 @@ static int prase_nand_parameter_from_dtb(struct meson_nfc *nfc, pr_debug("disa_irq_hand vale: %d\n", nfc->param_from_dts.disa_irq_hand); pr_debug("common_pageinfo: 0x%x\n", nfc->param_from_dts.common_pageinfo); + meson_nand_set_bootloader_mode(nfc->param_from_dts.bl_mode); + meson_nand_set_fipsize(nfc->param_from_dts.fip_size); + meson_nand_set_fipcopies(nfc->param_from_dts.fip_copies); + meson_nand_set_skip_bad_block(nfc->param_from_dts.skip_bad_block); + return ret; } @@ -1985,16 +1981,6 @@ static const struct meson_nfc_data meson_single_ecc_data = { .ecc_caps = &meson_512_ecc_caps, }; -static const struct meson_nfc_data meson_full_ecc_bl2ex_data = { - .ecc_caps = &meson_1K_ecc_caps, - .bl2ex_mode = 1, -}; - -static const struct meson_nfc_data meson_single_ecc_bl2ex_data = { - .ecc_caps = &meson_512_ecc_caps, - .bl2ex_mode = 1, -}; - static const struct of_device_id meson_nfc_id_table[] = { { .compatible = "amlogic,meson-nfc-full-ecc", @@ -2002,12 +1988,6 @@ static const struct of_device_id meson_nfc_id_table[] = { }, { .compatible = "amlogic,meson-nfc-single-ecc", .data = (void *)&meson_single_ecc_data, - }, { - .compatible = "amlogic,meson-nfc-full-ecc-bl2ex", - .data = (void *)&meson_full_ecc_bl2ex_data, - }, { - .compatible = "amlogic,meson-nfc-single-ecc-bl2ex", - .data = (void *)&meson_single_ecc_bl2ex_data, }, {} }; @@ -2142,7 +2122,6 @@ static int meson_nfc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, nfc); - register_mtd_parser(&ofpart_meson_parser); ret = meson_nfc_nand_chips_init(dev, nfc); if (ret) { dev_err(dev, "failed to init NAND chips\n"); diff --git a/drivers/mtd/spinand/Makefile b/drivers/mtd/spinand/Makefile index 8eb15f3e4..d2105ddf7 100644 --- a/drivers/mtd/spinand/Makefile +++ b/drivers/mtd/spinand/Makefile @@ -2,7 +2,7 @@ MODULE_NAME = amlogic-spinand obj-$(CONFIG_AMLOGIC_MTD_SPI_NAND) = $(MODULE_NAME).o -$(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_SPI_NAND) += core.o gigadevice.o macronix.o micron.o paragon.o toshiba.o winbond.o dosilicon.o foresee.o meson_spinand.o crypto.o +$(MODULE_NAME)-$(CONFIG_AMLOGIC_MTD_SPI_NAND) += core.o gigadevice.o macronix.o micron.o paragon.o toshiba.o winbond.o dosilicon.o foresee.o meson_spinand.o PR_FMT = $(subst amlogic-,,$(MODULE_NAME)) PR_FMT_DEFINE="-Dpr_fmt(fmt)= \"[$(PR_FMT)]: \" fmt" diff --git a/drivers/mtd/spinand/core.c b/drivers/mtd/spinand/core.c index 5ef465db5..0f077105b 100644 --- a/drivers/mtd/spinand/core.c +++ b/drivers/mtd/spinand/core.c @@ -6,7 +6,6 @@ * Peter Pan * Boris Brezillon */ - #include #include #include @@ -22,6 +21,7 @@ #include #include #include +#include static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val) { diff --git a/drivers/mtd/spinand/meson_spinand.c b/drivers/mtd/spinand/meson_spinand.c index f3486f3f2..ef248c20a 100644 --- a/drivers/mtd/spinand/meson_spinand.c +++ b/drivers/mtd/spinand/meson_spinand.c @@ -33,25 +33,12 @@ #define NAND_BLOCK_BAD 1 #define NAND_FACTORY_BAD 2 -#define NAND_FIPMODE_COMPACT (0) -#define NAND_FIPMODE_DISCRETE (1) -#define NAND_FIPMODE_ADVANCE (2) //#define CONFIG_NOT_SKIP_BAD_BLOCK -struct meson_partition_platform_data { - u32 reserved_part_blk_num; - u32 bl_mode; - u32 fip_copies; - u32 fip_size; - struct mtd_partition *part; - u32 part_num; -}; - struct meson_spinand { struct mtd_info *mtd; struct spinand_device *spinand; struct meson_rsv_handler_t *rsv; - struct meson_partition_platform_data *pdata; s8 *block_status; unsigned int erasesize_shift; }; @@ -107,10 +94,8 @@ void meson_spinand_rsv_release_device(struct mtd_info *mtd) void spinand_get_tpl_info(u32 *fip_size, u32 *fip_copies) { - if (meson_spinand_global->pdata) { - *fip_size = meson_spinand_global->pdata->fip_size; - *fip_copies = meson_spinand_global->pdata->fip_copies; - } + *fip_size = meson_nand_get_fipsize(); + *fip_copies = meson_nand_get_fipcopies(); } EXPORT_SYMBOL_GPL(spinand_get_tpl_info); @@ -187,11 +172,54 @@ static int spinand_mtd_block_markbad(struct mtd_info *mtd, loff_t offs) return -EINVAL; } +static int meson_spinand_parse_dt(struct mtd_info *mtd) +{ + u32 bl_mode, fip_copies, fip_size = 0; + struct device_node *np = mtd_get_of_node(mtd); + + if (!np) { + pr_err("%s %d: can't get np\n", __func__, __LINE__); + return -ENODEV; + } + + if (of_property_read_u32(np, "bl_mode", &bl_mode)) { + pr_info("%s %d: use default discrete mode\n\n", __func__, __LINE__); + bl_mode = NAND_FIPMODE_DISCRETE; + } + + if (bl_mode == NAND_FIPMODE_DISCRETE) { + if (of_property_read_u32(np, "fip_size", &fip_size)) { + pr_err("%s %d: no fip size in dts\n", __func__, __LINE__); + return -EINVAL; + } + } + + if (of_property_read_u32(np, "fip_copies", &fip_copies)) { + pr_err("%s %d: no fip size in dts\n", __func__, __LINE__); + return -EINVAL; + } + + meson_nand_set_bootloader_mode(bl_mode); + meson_nand_set_fipsize(fip_size); + meson_nand_set_fipcopies(fip_copies); +#ifndef CONFIG_NOT_SKIP_BAD_BLOCK + meson_nand_set_skip_bad_block(1); +#else + meson_nand_set_skip_bad_block(0); +#endif + + return 0; +} + int meson_spinand_init(struct spinand_device *spinand, struct mtd_info *mtd) { struct meson_spinand *meson_spinand = NULL; int err = 0; + err = meson_spinand_parse_dt(mtd); + if (err) + return err; + meson_spinand = kzalloc(sizeof(*meson_spinand), GFP_KERNEL); if (!meson_spinand) return -ENOMEM; @@ -217,6 +245,7 @@ int meson_spinand_init(struct spinand_device *spinand, struct mtd_info *mtd) goto exit_error1; } + mtd->name = AML_MTD_NAME; mtd->_block_isbad = spinand_mtd_block_isbad; mtd->_block_markbad = spinand_mtd_block_markbad; mtd->_block_isreserved = NULL; @@ -249,242 +278,6 @@ exit_error2: } EXPORT_SYMBOL_GPL(meson_spinand_init); -static struct meson_partition_platform_data * - meson_partition_parse_platform_data(struct device_node *np) -{ - struct meson_partition_platform_data *pdata = NULL; - struct device_node *part_np, *child; - struct mtd_partition *part; - phandle phandles; - int part_num, ret; - - if (!np) - return NULL; - - ret = of_property_read_u32(np, "partition", (u32 *)&phandles); - if (ret) { - pr_info("%s: no partition in dts\n", __func__); - return NULL; - } - - part_np = of_find_node_by_phandle(phandles); - if (!part_np) { - pr_info("%s: partition handle error\n", __func__); - return NULL; - } - - child = of_get_next_child(part_np, NULL); - part_num = of_get_child_count(part_np); - if (!child || !part_num) { - pr_info("%s: no partition table in dts\n", __func__); - return NULL; - } - - pdata = kzalloc(sizeof(*pdata) + sizeof(*part) * part_num, - GFP_KERNEL); - pdata->part = (struct mtd_partition *)&pdata[1]; - pdata->part_num = part_num; - meson_spinand_global->pdata = pdata; - - ret = of_property_read_u32(np, "bl_mode", &pdata->bl_mode); - if (ret) { - pdata->bl_mode = NAND_FIPMODE_DISCRETE; - pr_info("%s: use default discrete mode\n\n", __func__); - } - - if (pdata->bl_mode == NAND_FIPMODE_COMPACT) - pr_debug("bl_mode compact\n"); - else if (pdata->bl_mode == NAND_FIPMODE_DISCRETE) - pr_debug("bl_mode discrete\n"); - else if (pdata->bl_mode == NAND_FIPMODE_ADVANCE) - pr_debug("bl_mode advance\n"); - - if (pdata->bl_mode == NAND_FIPMODE_DISCRETE) { - ret = of_property_read_u32(np, "fip_size", &pdata->fip_size); - if (ret) { - pr_info("%s: no fip size in dts\n", __func__); - return NULL; - } - } - - ret = of_property_read_u32(np, "fip_copies", &pdata->fip_copies); - if (ret) { - pr_info("%s: no fip copies in dts\n", __func__); - return NULL; - } - - part = pdata->part; - for_each_child_of_node(part_np, child) { - part->name = (char *)child->name; - if (of_property_read_u64(child, "offset", &part->offset)) - goto parse_err; - if (of_property_read_u64(child, "size", &part->size)) - goto parse_err; - part++; - } - - return pdata; - -parse_err: - kfree(pdata); - return NULL; -} - -static void meson_partition_relocate(struct mtd_info *mtd, - struct mtd_partition *part) -{ -#ifndef CONFIG_NOT_SKIP_BAD_BLOCK - struct meson_spinand *meson_spinand = meson_spinand_global; - struct nand_device *nand = mtd_to_nanddev(mtd); - struct nand_pos pos; - loff_t offset = part->offset; - loff_t end = offset + part->size; - - BUG_ON(!meson_spinand->block_status); - while (offset < end) { - nanddev_offs_to_pos(nand, offset, &pos); - if (meson_spinand->block_status[pos.eraseblock] == NAND_FACTORY_BAD) { - pr_err("add partition detect FBB at %llx\n", - (u64)offset); - part->size += mtd->erasesize; - end += mtd->erasesize; - if (end > mtd->size) - break; - } - offset += mtd->erasesize; - } -#endif -} - -#ifdef CONFIG_NAND_ENCRYPTION -static void mtd_loop_encrypted_partition(struct mtd_info *mtd) -{ - struct mtd_info *child, *master = mtd_get_master(mtd); - struct mtd_partition part, *ppart; - - ppart = ∂ - mutex_lock(&master->master.partitions_lock); - list_for_each_entry(child, &mtd->partitions, part.node) { - ppart->offset = child->part.offset; - ppart->size = child->part.size; - ppart->name = child->name; - set_region_encrypted(mtd, ppart, true); - } - mutex_unlock(&master->master.partitions_lock); -} -#endif - -static const char * const meson_mtd_types[] = { - "cmdlinepart", - "meson_spinand_ofpartitions", - NULL -}; - -static int meson_parse_partitions(struct mtd_info *master, - const struct mtd_partition **pparts, - struct mtd_part_parser_data *data) -{ - struct meson_partition_platform_data *pdata; - struct mtd_partition *part; - loff_t offset; - u32 rsv_block_num = meson_rsv_get_block_cnt(); - int i = 0; - - pdata = meson_partition_parse_platform_data(mtd_get_of_node(master)); - if (!pdata) - return -ENODATA; - - /* bootloader */ - part = pdata->part; - offset = 0; - part->offset = offset; - part->size = SPI_NAND_BOOT_TOTAL_PAGES * master->writesize; - offset += part->size; - - if (pdata->bl_mode == NAND_FIPMODE_ADVANCE) { - /* get boot area entry form env */ - aml_nand_param_check_and_layout_init(master); - /* bl2e, bl2x, ddrfip, devfip */ - for (i = 1; i < (BOOT_AREA_DEVFIP + 1); i++) { - part[i].offset = - g_ssp.boot_entry[i].offset; - if (i == BOOT_AREA_DEVFIP) /* devfip */ - part[i].size = g_ssp.boot_entry[i].size * - pdata->fip_copies; - else - part[i].size = g_ssp.boot_entry[i].size * - g_ssp.boot_backups; - pr_debug("%s: off %llx, size %llx\n", - part[i].name, part[i].offset, - part[i].size); - } - offset = part[BOOT_AREA_DEVFIP].offset + part[BOOT_AREA_DEVFIP].size; - i = pdata->part_num - 6; - part += 4; - } else if (pdata->bl_mode == NAND_FIPMODE_DISCRETE) { - /* skip rsv */ - offset += rsv_block_num * (loff_t)master->erasesize; - - /* tpl, support NAND_FIPMODE_DISCRETE only */ - part++; - part->offset = offset; - part->size = pdata->fip_copies * pdata->fip_size; - offset += part->size; - - i = pdata->part_num - 3; - } else { - pr_err("Invalid mode!\n"); - kfree(pdata); - return -EINVAL; - } - - while (i--) { - part++; - part->offset = offset; - meson_partition_relocate(master, part); - offset += part->size; - if (offset > master->size) { - kfree(pdata); - pr_err("%s: offset %llx over device size %llx\n", __func__, - offset, master->size); - return -ENOSPC; - } - } - - /* data */ - part++; - part->offset = offset; - part->size = master->size - offset; - - *pparts = kmemdup(pdata->part, sizeof(*pdata->part) * pdata->part_num, - GFP_KERNEL); - if (!*pparts) - return -ENOMEM; - - return pdata->part_num; -} - -struct mtd_part_parser meson_spinand_parser = { - .parse_fn = meson_parse_partitions, - .name = "meson_spinand_ofpartitions", -}; - -int meson_add_mtd_partitions(struct mtd_info *mtd) -{ - mtd->name = "aml-mtd"; - register_mtd_parser(&meson_spinand_parser); - if (mtd_device_parse_register(mtd, meson_mtd_types, NULL, NULL, 0) != 0) { - pr_err("%s() register partitions failed\n", __func__); - return -1; - } - -#ifdef CONFIG_NAND_ENCRYPTION - mtd_loop_encrypted_partition(mtd); -#endif - return 0; -} -EXPORT_SYMBOL_GPL(meson_add_mtd_partitions); - MODULE_DESCRIPTION("MESON SPI NAND INTERFACE"); MODULE_AUTHOR("sunny luo"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/amlogic/aml_mtd_nand.h b/include/linux/amlogic/aml_mtd_nand.h index eda6286c0..7fdb4a3cd 100644 --- a/include/linux/amlogic/aml_mtd_nand.h +++ b/include/linux/amlogic/aml_mtd_nand.h @@ -115,7 +115,6 @@ /* Max total is 1024 as romboot says so... */ #define BOOT_TOTAL_PAGES (1024) -#define NAND_FIPMODE_DISCRETE (1) struct meson_nfc_nand_chip { struct list_head node; struct nand_chip nand; diff --git a/include/linux/amlogic/aml_rsv.h b/include/linux/amlogic/aml_rsv.h index a262818c0..1c208ce4f 100644 --- a/include/linux/amlogic/aml_rsv.h +++ b/include/linux/amlogic/aml_rsv.h @@ -24,8 +24,6 @@ #define SEC_NAND_MAGIC "nsec" #define DTB_NAND_MAGIC "ndtb" -#define NAND_BOOT_NAME "bootloader" -#define NAND_NORMAL_NAME "nandnormal" /*define abnormal state for reserved area*/ #define POWER_ABNORMAL_FLAG 0x01 #define ECC_ABNORMAL_FLAG 0x02 diff --git a/include/linux/amlogic/aml_spi_nand.h b/include/linux/amlogic/aml_spi_nand.h index ab9b40a35..05d468379 100644 --- a/include/linux/amlogic/aml_spi_nand.h +++ b/include/linux/amlogic/aml_spi_nand.h @@ -79,7 +79,6 @@ struct spinand_front_info_page { }; int meson_spinand_init(struct spinand_device *spinand, struct mtd_info *mtd); -int meson_add_mtd_partitions(struct mtd_info *mtd); void spinand_get_tpl_info(u32 *fip_size, u32 *fip_copies); bool meson_spinand_isbad(struct nand_device *nand, const struct nand_pos *pos); int spinand_mtd_write_unlock(struct mtd_info *mtd, loff_t to, diff --git a/include/linux/amlogic/aml_storage.h b/include/linux/amlogic/aml_storage.h index 5921e370a..4fa2444b5 100644 --- a/include/linux/amlogic/aml_storage.h +++ b/include/linux/amlogic/aml_storage.h @@ -29,6 +29,17 @@ #define BAE_DDRFIP "DDRFIP" #define BAE_DEVFIP "DEVFIP" +#define NAND_FIPMODE_COMPACT (0) +#define NAND_FIPMODE_DISCRETE (1) +#define NAND_FIPMODE_ADVANCE (2) + +/*cmdline_parser - MTD Master Name*/ +#define AML_MTD_NAME "aml-mtd" + +/* slc nand mtd name */ +#define NAND_BOOT_NAME "bootloader" +#define NAND_NORMAL_NAME AML_MTD_NAME + struct boot_area_entry { char name[11]; unsigned char idx; @@ -69,6 +80,14 @@ struct storage_startup_parameter { extern struct storage_startup_parameter g_ssp; int aml_nand_param_check_and_layout_init(struct mtd_info *mtd); +void meson_nand_set_fipsize(u32 fip_size); +u32 meson_nand_get_fipsize(void); +void meson_nand_set_fipcopies(u32 fip_copies); +u32 meson_nand_get_fipcopies(void); +void meson_nand_set_bootloader_mode(u32 bl_mode); +u32 meson_nand_get_bootloader_mode(void); +void meson_nand_set_skip_bad_block(u32 skip); +int meson_add_mtd_partitions(struct mtd_info *mtd); /**sc2 new layout**/ #endif /* __AML_STORAGE_H_ */