arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
PATCH 1/2 arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
All partitions are created by fixup_mtd_partitions() function, so they do not have to exist just for their removal need.
--- board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
board/CZ.NIC/turris_omnia/turris_omnia.c +4 -5
@@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)int parts; parts =fdt_subnode_offset (blob, offset,"partitions" ); -if (parts <0 ) -return false; - -if (fdt_del_node (blob, parts) <0 ) -return false; +if (parts >=0 ) { +if (fdt_del_node (blob, parts) <0 ) +return false; + } parts =fdt_add_subnode (blob, offset,"partitions" );if (parts <0 )
Signature · 1 line
2.20.1
PATCH 2/2 arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
Sometimes fixup_mtd_partitions() prints during booting kernel error "Failed fixing SPI NOR partitions!" because it does not have enough space for creating all paritions nodes. So increase fdt size.
--- board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++ 1 file changed, 3 insertions(+)
board/CZ.NIC/turris_omnia/turris_omnia.c +3 -0
@@ -979,6 +979,9 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)return false; } +if (fdt_increase_size (blob,512 ) <0 ) +return false; + parts =fdt_add_subnode (blob, offset,"partitions" );if (parts <0 )return false;
Signature · 1 line
2.20.1
Re: [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
Quoted 6 lines · Pali Rohár
Sometimes
fixup_mtd_partitions()prints during booting kernel error "Failed fixing SPI NOR partitions!" because it does not have enough space for creating all paritions nodes. So increase fdt size.Fixes 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")Signed-off-by Pali Rohár <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++ 1 file changed, 3 insertions(+)board/CZ.NIC/turris_omnia/turris_omnia.c +0
-0
board/CZ.NIC/turris_omnia/turris_omnia.c static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd) · line 987
Quoted 9 lines
board/CZ.NIC/turris_omnia/turris_omnia.c +3
-0@@ -979,6 +979,9 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)return false; } +if (fdt_increase_size (blob,512 ) <0 ) +return false; + parts =fdt_add_subnode (blob, offset,"partitions" );if (parts <0 )return false;
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Re: [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
In reply to Pali RohárQuoted 6 lines · On Mon, 1 Aug 2022 12:02:20 +0200 Pali Rohár <[email protected]> wrote:
Sometimes
fixup_mtd_partitions()prints during booting kernel error "Failed fixing SPI NOR partitions!" because it does not have enough space for creating all paritions nodes. So increase fdt size.Fixes 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")Signed-off-by Pali Rohár <[email protected]>
Re: [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
In reply to Pali RohárQuoted 6 lines · Pali Rohár
Sometimes
fixup_mtd_partitions()prints during booting kernel error "Failed fixing SPI NOR partitions!" because it does not have enough space for creating all paritions nodes. So increase fdt size.Fixes 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 9 lines
--- board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++ 1 file changed, 3 insertions(+)board/CZ.NIC/turris_omnia/turris_omnia.c +0
-0
board/CZ.NIC/turris_omnia/turris_omnia.c static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd) · line 987
Quoted 9 lines
board/CZ.NIC/turris_omnia/turris_omnia.c +3
-0@@ -979,6 +979,9 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)return false; } +if (fdt_increase_size (blob,512 ) <0 ) +return false; + parts =fdt_add_subnode (blob, offset,"partitions" );if (parts <0 )return false;
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 5 lines · Pali Rohár
All partitions are created by
fixup_mtd_partitions()function, so they do not have to exist just for their removal need.Fixes 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")Signed-off-by Pali Rohár <[email protected]>
Thanks,
Stefan
Quoted 14 lines
--- board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)board/CZ.NIC/turris_omnia/turris_omnia.c +0
-2@@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)int parts; parts =fdt_subnode_offset (blob, offset,"partitions" ); -if (parts <0 ) -return false;
board/CZ.NIC/turris_omnia/turris_omnia.c static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd) · line 983
Quoted 10 lines
board/CZ.NIC/turris_omnia/turris_omnia.c +4
-3- -if (fdt_del_node (blob, parts) <0 ) -return false; +if (parts >=0 ) { +if (fdt_del_node (blob, parts) <0 ) +return false; + } parts =fdt_add_subnode (blob, offset,"partitions" );if (parts <0 )
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 5 lines · On Mon, 1 Aug 2022 12:02:19 +0200 Pali Rohár <[email protected]> wrote:
All partitions are created by
fixup_mtd_partitions()function, so they do not have to exist just for their removal need.Fixes 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")Signed-off-by Pali Rohár <[email protected]>
Quoted 5 lines · Pali Rohár
All partitions are created by
fixup_mtd_partitions()function, so they do not have to exist just for their removal need.Fixes 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 14 lines
--- board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)board/CZ.NIC/turris_omnia/turris_omnia.c +0
-2@@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)int parts; parts =fdt_subnode_offset (blob, offset,"partitions" ); -if (parts <0 ) -return false;
board/CZ.NIC/turris_omnia/turris_omnia.c static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd) · line 983
Quoted 10 lines
board/CZ.NIC/turris_omnia/turris_omnia.c +4
-3- -if (fdt_del_node (blob, parts) <0 ) -return false; +if (parts >=0 ) { +if (fdt_del_node (blob, parts) <0 ) +return false; + } parts =fdt_add_subnode (blob, offset,"partitions" );if (parts <0 )
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]