* [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates
@ 2023-03-25 0:02 Martin Rowe
2023-03-25 0:02 ` [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection Martin Rowe
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Martin Rowe @ 2023-03-25 0:02 UTC (permalink / raw)
To: pali, sr; +Cc: josua, jon, mibodhi, u-boot, Martin Rowe
Minor defconfig and eMMC updates for SolidRun's A388 Clearfog devices.
Changes since v1:
- Omitted defconfig canonicalization changes
- Removed unneeded defconfig changes
- Set non-removable in u-boot dtsi instead of MMC_BROKEN_CD
- Reworked FDT patch logic
Changes since initial discussion:
https://lists.denx.de/pipermail/u-boot/2023-February/510492.html
- CONFIG_SPL_SPI selected for SPI defconfig
- Runtime patching of kernel FDT added for eMMC detection
Note that this patch depends on this patch series (has been merged to
u-boot-marvell/next):
https://lists.denx.de/pipermail/u-boot/2023-March/511038.html
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
Martin Rowe (3):
arm: mvebu: clearfog: Fix MMC detection
arm: mvebu: clearfog: Add defconfig for SPI booting
arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 1 +
arch/arm/mach-mvebu/Kconfig | 1 +
board/solidrun/clearfog/clearfog.c | 32 +++++++++++++++++++
...arfog_defconfig => clearfog_spi_defconfig} | 2 +-
4 files changed, 35 insertions(+), 1 deletion(-)
copy configs/{clearfog_defconfig => clearfog_spi_defconfig} (98%)
--
2.40.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection
2023-03-25 0:02 [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Martin Rowe
@ 2023-03-25 0:02 ` Martin Rowe
2023-03-27 7:00 ` Stefan Roese
2023-03-25 0:02 ` [PATCH v2 2/3] arm: mvebu: clearfog: Add defconfig for SPI booting Martin Rowe
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Martin Rowe @ 2023-03-25 0:02 UTC (permalink / raw)
To: pali, sr; +Cc: josua, jon, mibodhi, u-boot, Martin Rowe
A388 Clearfog MMC is either SD Card or eMMC with different behaviour for
both. Setting the device to non-removable in the u-boot.dtsi allows both
to correctly detect the device.
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
---
arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
index fb27a3b96f..906d8f2e67 100644
--- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
+++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
@@ -10,6 +10,7 @@
&sdhci {
bootph-pre-ram;
+ non-removable; /* assume that the card is always present, required for eMMC variant */
};
&gpio0 {
--
2.40.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2 2/3] arm: mvebu: clearfog: Add defconfig for SPI booting
2023-03-25 0:02 [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Martin Rowe
2023-03-25 0:02 ` [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection Martin Rowe
@ 2023-03-25 0:02 ` Martin Rowe
2023-03-27 7:00 ` Stefan Roese
2023-03-25 0:02 ` [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt Martin Rowe
` (2 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Martin Rowe @ 2023-03-25 0:02 UTC (permalink / raw)
To: pali, sr; +Cc: josua, jon, mibodhi, u-boot, Martin Rowe
This new clearfog_spi_defconfig file is a copy of existing
clearfog_defconfig file modified to instruct build system to generate
final kwbimage for SPI booting and to store the environment in SPI.
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
---
configs/{clearfog_defconfig => clearfog_spi_defconfig} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
copy configs/{clearfog_defconfig => clearfog_spi_defconfig} (98%)
diff --git a/configs/clearfog_defconfig b/configs/clearfog_spi_defconfig
similarity index 98%
copy from configs/clearfog_defconfig
copy to configs/clearfog_spi_defconfig
index 8cd35f9f1a..9dcf16fe92 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_spi_defconfig
@@ -9,7 +9,7 @@ CONFIG_NR_DRAM_BANKS=2
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xff0000
CONFIG_TARGET_CLEARFOG=y
-CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
+CONFIG_ENV_SECT_SIZE=0x10000
CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
CONFIG_SPL_TEXT_BASE=0x40000030
CONFIG_SPL_SERIAL=y
--
2.40.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
2023-03-25 0:02 [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Martin Rowe
2023-03-25 0:02 ` [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection Martin Rowe
2023-03-25 0:02 ` [PATCH v2 2/3] arm: mvebu: clearfog: Add defconfig for SPI booting Martin Rowe
@ 2023-03-25 0:02 ` Martin Rowe
2023-03-27 7:09 ` Stefan Roese
2023-03-25 12:32 ` [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Pali Rohár
2023-03-30 8:18 ` Stefan Roese
4 siblings, 1 reply; 14+ messages in thread
From: Martin Rowe @ 2023-03-25 0:02 UTC (permalink / raw)
To: pali, sr; +Cc: josua, jon, mibodhi, u-boot, Martin Rowe
[upstream of vendor commit 19a96f7c40a8fc1d0a6546ac2418d966e5840a99]
The Clearfog devices have only one SDHC device. This is either eMMC if
it is populated on the SOM or SDHC if not. The Linux device tree assumes
the SDHC case. Detect if the device is an eMMC and fixup the device-tree
so it will be detected by Linux.
Ported from vendor repo at https://github.com/SolidRun/u-boot
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
---
arch/arm/mach-mvebu/Kconfig | 1 +
board/solidrun/clearfog/clearfog.c | 32 ++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index fb3cff43f7..773635d691 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -107,6 +107,7 @@ config TARGET_CLEARFOG
bool "Support ClearFog"
select 88F6820
select BOARD_LATE_INIT
+ select OF_BOARD_SETUP
config TARGET_HELIOS4
bool "Support Helios4"
diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index 03adb591d8..0087fea7db 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -10,6 +10,7 @@
#include <miiphy.h>
#include <net.h>
#include <netdev.h>
+#include <mmc.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch/cpu.h>
@@ -261,3 +262,34 @@ int board_late_init(void)
return 0;
}
+
+static bool has_emmc(void)
+{
+ struct mmc *mmc;
+ mmc = find_mmc_device(0);
+ if (!mmc)
+ return 0;
+ return (!mmc_init(mmc) && IS_MMC(mmc)) ? true : false;
+}
+
+/*
+ * The Clearfog devices have only one SDHC device. This is either eMMC
+ * if it is populated on the SOM or SDHC if not. The Linux device tree
+ * assumes the SDHC case. Detect if the device is an eMMC and fixup the
+ * device-tree, so that it will be detected by Linux.
+ */
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+ __maybe_unused int node;
+
+ if (has_emmc()) {
+ node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-380-sdhci");
+ if (node < 0)
+ return 0; /* Unexpected eMMC device; patching not supported */
+
+ puts("Patching FDT so that eMMC is detected by OS\n");
+ return fdt_setprop_empty(blob, node, "non-removable");
+ }
+
+ return 0;
+}
--
2.40.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates
2023-03-25 0:02 [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Martin Rowe
` (2 preceding siblings ...)
2023-03-25 0:02 ` [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt Martin Rowe
@ 2023-03-25 12:32 ` Pali Rohár
2023-03-30 8:18 ` Stefan Roese
4 siblings, 0 replies; 14+ messages in thread
From: Pali Rohár @ 2023-03-25 12:32 UTC (permalink / raw)
To: Martin Rowe; +Cc: sr, josua, jon, mibodhi, u-boot
On Saturday 25 March 2023 10:02:42 Martin Rowe wrote:
> Minor defconfig and eMMC updates for SolidRun's A388 Clearfog devices.
>
> Changes since v1:
> - Omitted defconfig canonicalization changes
> - Removed unneeded defconfig changes
> - Set non-removable in u-boot dtsi instead of MMC_BROKEN_CD
> - Reworked FDT patch logic
>
> Changes since initial discussion:
> https://lists.denx.de/pipermail/u-boot/2023-February/510492.html
> - CONFIG_SPL_SPI selected for SPI defconfig
> - Runtime patching of kernel FDT added for eMMC detection
>
> Note that this patch depends on this patch series (has been merged to
> u-boot-marvell/next):
> https://lists.denx.de/pipermail/u-boot/2023-March/511038.html
>
> Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
>
> Martin Rowe (3):
> arm: mvebu: clearfog: Fix MMC detection
> arm: mvebu: clearfog: Add defconfig for SPI booting
> arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
>
> arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 1 +
> arch/arm/mach-mvebu/Kconfig | 1 +
> board/solidrun/clearfog/clearfog.c | 32 +++++++++++++++++++
> ...arfog_defconfig => clearfog_spi_defconfig} | 2 +-
> 4 files changed, 35 insertions(+), 1 deletion(-)
> copy configs/{clearfog_defconfig => clearfog_spi_defconfig} (98%)
>
> --
> 2.40.0
>
Looks good,
Reviewed-by: Pali Rohár <pali@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection
2023-03-25 0:02 ` [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection Martin Rowe
@ 2023-03-27 7:00 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2023-03-27 7:00 UTC (permalink / raw)
To: Martin Rowe, pali; +Cc: josua, jon, mibodhi, u-boot
On 3/25/23 01:02, Martin Rowe wrote:
> A388 Clearfog MMC is either SD Card or eMMC with different behaviour for
> both. Setting the device to non-removable in the u-boot.dtsi allows both
> to correctly detect the device.
>
> Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
> index fb27a3b96f..906d8f2e67 100644
> --- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
> +++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
> @@ -10,6 +10,7 @@
>
> &sdhci {
> bootph-pre-ram;
> + non-removable; /* assume that the card is always present, required for eMMC variant */
> };
>
> &gpio0 {
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/3] arm: mvebu: clearfog: Add defconfig for SPI booting
2023-03-25 0:02 ` [PATCH v2 2/3] arm: mvebu: clearfog: Add defconfig for SPI booting Martin Rowe
@ 2023-03-27 7:00 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2023-03-27 7:00 UTC (permalink / raw)
To: Martin Rowe, pali; +Cc: josua, jon, mibodhi, u-boot
On 3/25/23 01:02, Martin Rowe wrote:
> This new clearfog_spi_defconfig file is a copy of existing
> clearfog_defconfig file modified to instruct build system to generate
> final kwbimage for SPI booting and to store the environment in SPI.
>
> Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> configs/{clearfog_defconfig => clearfog_spi_defconfig} | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> copy configs/{clearfog_defconfig => clearfog_spi_defconfig} (98%)
>
> diff --git a/configs/clearfog_defconfig b/configs/clearfog_spi_defconfig
> similarity index 98%
> copy from configs/clearfog_defconfig
> copy to configs/clearfog_spi_defconfig
> index 8cd35f9f1a..9dcf16fe92 100644
> --- a/configs/clearfog_defconfig
> +++ b/configs/clearfog_spi_defconfig
> @@ -9,7 +9,7 @@ CONFIG_NR_DRAM_BANKS=2
> CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xff0000
> CONFIG_TARGET_CLEARFOG=y
> -CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
> +CONFIG_ENV_SECT_SIZE=0x10000
> CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
> CONFIG_SPL_TEXT_BASE=0x40000030
> CONFIG_SPL_SERIAL=y
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
2023-03-25 0:02 ` [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt Martin Rowe
@ 2023-03-27 7:09 ` Stefan Roese
2023-03-27 10:34 ` Martin Rowe
2023-03-27 11:24 ` [PATCH v3 " Martin Rowe
0 siblings, 2 replies; 14+ messages in thread
From: Stefan Roese @ 2023-03-27 7:09 UTC (permalink / raw)
To: Martin Rowe, pali; +Cc: josua, jon, mibodhi, u-boot
Hi Martin,
On 3/25/23 01:02, Martin Rowe wrote:
> [upstream of vendor commit 19a96f7c40a8fc1d0a6546ac2418d966e5840a99]
>
> The Clearfog devices have only one SDHC device. This is either eMMC if
> it is populated on the SOM or SDHC if not. The Linux device tree assumes
> the SDHC case. Detect if the device is an eMMC and fixup the device-tree
> so it will be detected by Linux.
>
> Ported from vendor repo at https://github.com/SolidRun/u-boot
>
> Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
> ---
> arch/arm/mach-mvebu/Kconfig | 1 +
> board/solidrun/clearfog/clearfog.c | 32 ++++++++++++++++++++++++++++++
> 2 files changed, 33 insertions(+)
>
> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> index fb3cff43f7..773635d691 100644
> --- a/arch/arm/mach-mvebu/Kconfig
> +++ b/arch/arm/mach-mvebu/Kconfig
> @@ -107,6 +107,7 @@ config TARGET_CLEARFOG
> bool "Support ClearFog"
> select 88F6820
> select BOARD_LATE_INIT
> + select OF_BOARD_SETUP
>
> config TARGET_HELIOS4
> bool "Support Helios4"
> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
> index 03adb591d8..0087fea7db 100644
> --- a/board/solidrun/clearfog/clearfog.c
> +++ b/board/solidrun/clearfog/clearfog.c
> @@ -10,6 +10,7 @@
> #include <miiphy.h>
> #include <net.h>
> #include <netdev.h>
> +#include <mmc.h>
> #include <asm/global_data.h>
> #include <asm/io.h>
> #include <asm/arch/cpu.h>
> @@ -261,3 +262,34 @@ int board_late_init(void)
>
> return 0;
> }
> +
> +static bool has_emmc(void)
> +{
> + struct mmc *mmc;
Nitpicking: Please add an empty line after the variable declaration
section.
> + mmc = find_mmc_device(0);
> + if (!mmc)
> + return 0;
> + return (!mmc_init(mmc) && IS_MMC(mmc)) ? true : false;
> +}
> +
> +/*
> + * The Clearfog devices have only one SDHC device. This is either eMMC
> + * if it is populated on the SOM or SDHC if not. The Linux device tree
> + * assumes the SDHC case. Detect if the device is an eMMC and fixup the
> + * device-tree, so that it will be detected by Linux.
> + */
> +int ft_board_setup(void *blob, struct bd_info *bd)
> +{
> + __maybe_unused int node;
Is this "__maybe_unused" really needed here?
Otherwise:
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> +
> + if (has_emmc()) {
> + node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-380-sdhci");
> + if (node < 0)
> + return 0; /* Unexpected eMMC device; patching not supported */
> +
> + puts("Patching FDT so that eMMC is detected by OS\n");
> + return fdt_setprop_empty(blob, node, "non-removable");
> + }
> +
> + return 0;
> +}
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
2023-03-27 7:09 ` Stefan Roese
@ 2023-03-27 10:34 ` Martin Rowe
2023-03-27 11:18 ` Pali Rohár
2023-03-27 11:24 ` [PATCH v3 " Martin Rowe
1 sibling, 1 reply; 14+ messages in thread
From: Martin Rowe @ 2023-03-27 10:34 UTC (permalink / raw)
To: Stefan Roese; +Cc: pali, josua, jon, mibodhi, u-boot
On Mon, 27 Mar 2023 at 07:26, Stefan Roese <sr@denx.de> wrote:
>
> Hi Martin,
>
> On 3/25/23 01:02, Martin Rowe wrote:
> > [upstream of vendor commit 19a96f7c40a8fc1d0a6546ac2418d966e5840a99]
> >
> > The Clearfog devices have only one SDHC device. This is either eMMC if
> > it is populated on the SOM or SDHC if not. The Linux device tree assumes
> > the SDHC case. Detect if the device is an eMMC and fixup the device-tree
> > so it will be detected by Linux.
> >
> > Ported from vendor repo at https://github.com/SolidRun/u-boot
> >
> > Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
> > ---
> > arch/arm/mach-mvebu/Kconfig | 1 +
> > board/solidrun/clearfog/clearfog.c | 32 ++++++++++++++++++++++++++++++
> > 2 files changed, 33 insertions(+)
> >
> > diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> > index fb3cff43f7..773635d691 100644
> > --- a/arch/arm/mach-mvebu/Kconfig
> > +++ b/arch/arm/mach-mvebu/Kconfig
> > @@ -107,6 +107,7 @@ config TARGET_CLEARFOG
> > bool "Support ClearFog"
> > select 88F6820
> > select BOARD_LATE_INIT
> > + select OF_BOARD_SETUP
> >
> > config TARGET_HELIOS4
> > bool "Support Helios4"
> > diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
> > index 03adb591d8..0087fea7db 100644
> > --- a/board/solidrun/clearfog/clearfog.c
> > +++ b/board/solidrun/clearfog/clearfog.c
> > @@ -10,6 +10,7 @@
> > #include <miiphy.h>
> > #include <net.h>
> > #include <netdev.h>
> > +#include <mmc.h>
> > #include <asm/global_data.h>
> > #include <asm/io.h>
> > #include <asm/arch/cpu.h>
> > @@ -261,3 +262,34 @@ int board_late_init(void)
> >
> > return 0;
> > }
> > +
> > +static bool has_emmc(void)
> > +{
> > + struct mmc *mmc;
>
> Nitpicking: Please add an empty line after the variable declaration
> section.
>
> > + mmc = find_mmc_device(0);
> > + if (!mmc)
> > + return 0;
> > + return (!mmc_init(mmc) && IS_MMC(mmc)) ? true : false;
> > +}
> > +
> > +/*
> > + * The Clearfog devices have only one SDHC device. This is either eMMC
> > + * if it is populated on the SOM or SDHC if not. The Linux device tree
> > + * assumes the SDHC case. Detect if the device is an eMMC and fixup the
> > + * device-tree, so that it will be detected by Linux.
> > + */
> > +int ft_board_setup(void *blob, struct bd_info *bd)
> > +{
> > + __maybe_unused int node;
>
> Is this "__maybe_unused" really needed here?
>
> Otherwise:
>
> Reviewed-by: Stefan Roese <sr@denx.de>
>
> Thanks,
> Stefan
Hmm, I fixed these two things and thought I submitted with In-Reply-To
this thread, but it's gone and created a new untitled series in
patchwork for the fix. Is there anything I can do to fix that up?
Sorry for the hassle.
> > +
> > + if (has_emmc()) {
> > + node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-380-sdhci");
> > + if (node < 0)
> > + return 0; /* Unexpected eMMC device; patching not supported */
> > +
> > + puts("Patching FDT so that eMMC is detected by OS\n");
> > + return fdt_setprop_empty(blob, node, "non-removable");
> > + }
> > +
> > + return 0;
> > +}
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
2023-03-27 10:34 ` Martin Rowe
@ 2023-03-27 11:18 ` Pali Rohár
0 siblings, 0 replies; 14+ messages in thread
From: Pali Rohár @ 2023-03-27 11:18 UTC (permalink / raw)
To: Martin Rowe; +Cc: Stefan Roese, josua, jon, mibodhi, u-boot
On Monday 27 March 2023 10:34:59 Martin Rowe wrote:
> Hmm, I fixed these two things and thought I submitted with In-Reply-To
> this thread, but it's gone
Header is not gone, I received it, but you specified it incorrectly.
In your email is:
In-Reply-To: 38fb92cd-6619-28be-d3ac-0576c4c919e5@denx.de
But correct format is with angle brackets, so it should be:
In-Reply-To: <38fb92cd-6619-28be-d3ac-0576c4c919e5@denx.de>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v3 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
2023-03-27 7:09 ` Stefan Roese
2023-03-27 10:34 ` Martin Rowe
@ 2023-03-27 11:24 ` Martin Rowe
2023-03-30 4:58 ` Stefan Roese
1 sibling, 1 reply; 14+ messages in thread
From: Martin Rowe @ 2023-03-27 11:24 UTC (permalink / raw)
To: pali, sr; +Cc: josua, jon, mibodhi, u-boot, Martin Rowe
[upstream of vendor commit 19a96f7c40a8fc1d0a6546ac2418d966e5840a99]
The Clearfog devices have only one SDHC device. This is either eMMC if
it is populated on the SOM or SDHC if not. The Linux device tree assumes
the SDHC case. Detect if the device is an eMMC and fixup the device-tree
so it will be detected by Linux.
Ported from vendor repo at https://github.com/SolidRun/u-boot
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
---
Resend with correct header
Fixed spacing and removed __maybe_unused
arch/arm/mach-mvebu/Kconfig | 1 +
board/solidrun/clearfog/clearfog.c | 33 ++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 1f0dbef1c6..b1f2e97ae7 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -107,6 +107,7 @@ config TARGET_CLEARFOG
bool "Support ClearFog"
select 88F6820
select BOARD_LATE_INIT
+ select OF_BOARD_SETUP
config TARGET_HELIOS4
bool "Support Helios4"
diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index 03adb591d8..6edb422155 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -10,6 +10,7 @@
#include <miiphy.h>
#include <net.h>
#include <netdev.h>
+#include <mmc.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch/cpu.h>
@@ -261,3 +262,35 @@ int board_late_init(void)
return 0;
}
+
+static bool has_emmc(void)
+{
+ struct mmc *mmc;
+
+ mmc = find_mmc_device(0);
+ if (!mmc)
+ return 0;
+ return (!mmc_init(mmc) && IS_MMC(mmc)) ? true : false;
+}
+
+/*
+ * The Clearfog devices have only one SDHC device. This is either eMMC
+ * if it is populated on the SOM or SDHC if not. The Linux device tree
+ * assumes the SDHC case. Detect if the device is an eMMC and fixup the
+ * device-tree, so that it will be detected by Linux.
+ */
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+ int node;
+
+ if (has_emmc()) {
+ node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-380-sdhci");
+ if (node < 0)
+ return 0; /* Unexpected eMMC device; patching not supported */
+
+ puts("Patching FDT so that eMMC is detected by OS\n");
+ return fdt_setprop_empty(blob, node, "non-removable");
+ }
+
+ return 0;
+}
--
2.40.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v3 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
2023-03-27 11:24 ` [PATCH v3 " Martin Rowe
@ 2023-03-30 4:58 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2023-03-30 4:58 UTC (permalink / raw)
To: Martin Rowe, pali; +Cc: josua, jon, mibodhi, u-boot
On 3/27/23 13:24, Martin Rowe wrote:
> [upstream of vendor commit 19a96f7c40a8fc1d0a6546ac2418d966e5840a99]
>
> The Clearfog devices have only one SDHC device. This is either eMMC if
> it is populated on the SOM or SDHC if not. The Linux device tree assumes
> the SDHC case. Detect if the device is an eMMC and fixup the device-tree
> so it will be detected by Linux.
>
> Ported from vendor repo at https://github.com/SolidRun/u-boot
>
> Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> Resend with correct header
> Fixed spacing and removed __maybe_unused
>
> arch/arm/mach-mvebu/Kconfig | 1 +
> board/solidrun/clearfog/clearfog.c | 33 ++++++++++++++++++++++++++++++
> 2 files changed, 34 insertions(+)
>
> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> index 1f0dbef1c6..b1f2e97ae7 100644
> --- a/arch/arm/mach-mvebu/Kconfig
> +++ b/arch/arm/mach-mvebu/Kconfig
> @@ -107,6 +107,7 @@ config TARGET_CLEARFOG
> bool "Support ClearFog"
> select 88F6820
> select BOARD_LATE_INIT
> + select OF_BOARD_SETUP
>
> config TARGET_HELIOS4
> bool "Support Helios4"
> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
> index 03adb591d8..6edb422155 100644
> --- a/board/solidrun/clearfog/clearfog.c
> +++ b/board/solidrun/clearfog/clearfog.c
> @@ -10,6 +10,7 @@
> #include <miiphy.h>
> #include <net.h>
> #include <netdev.h>
> +#include <mmc.h>
> #include <asm/global_data.h>
> #include <asm/io.h>
> #include <asm/arch/cpu.h>
> @@ -261,3 +262,35 @@ int board_late_init(void)
>
> return 0;
> }
> +
> +static bool has_emmc(void)
> +{
> + struct mmc *mmc;
> +
> + mmc = find_mmc_device(0);
> + if (!mmc)
> + return 0;
> + return (!mmc_init(mmc) && IS_MMC(mmc)) ? true : false;
> +}
> +
> +/*
> + * The Clearfog devices have only one SDHC device. This is either eMMC
> + * if it is populated on the SOM or SDHC if not. The Linux device tree
> + * assumes the SDHC case. Detect if the device is an eMMC and fixup the
> + * device-tree, so that it will be detected by Linux.
> + */
> +int ft_board_setup(void *blob, struct bd_info *bd)
> +{
> + int node;
> +
> + if (has_emmc()) {
> + node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-380-sdhci");
> + if (node < 0)
> + return 0; /* Unexpected eMMC device; patching not supported */
> +
> + puts("Patching FDT so that eMMC is detected by OS\n");
> + return fdt_setprop_empty(blob, node, "non-removable");
> + }
> +
> + return 0;
> +}
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates
2023-03-25 0:02 [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Martin Rowe
` (3 preceding siblings ...)
2023-03-25 12:32 ` [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Pali Rohár
@ 2023-03-30 8:18 ` Stefan Roese
4 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2023-03-30 8:18 UTC (permalink / raw)
To: Martin Rowe, pali; +Cc: josua, jon, mibodhi, u-boot
On 3/25/23 01:02, Martin Rowe wrote:
> Minor defconfig and eMMC updates for SolidRun's A388 Clearfog devices.
>
> Changes since v1:
> - Omitted defconfig canonicalization changes
> - Removed unneeded defconfig changes
> - Set non-removable in u-boot dtsi instead of MMC_BROKEN_CD
> - Reworked FDT patch logic
>
> Changes since initial discussion:
> https://lists.denx.de/pipermail/u-boot/2023-February/510492.html
> - CONFIG_SPL_SPI selected for SPI defconfig
> - Runtime patching of kernel FDT added for eMMC detection
>
> Note that this patch depends on this patch series (has been merged to
> u-boot-marvell/next):
> https://lists.denx.de/pipermail/u-boot/2023-March/511038.html
>
> Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
>
> Martin Rowe (3):
> arm: mvebu: clearfog: Fix MMC detection
> arm: mvebu: clearfog: Add defconfig for SPI booting
> arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
>
> arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 1 +
> arch/arm/mach-mvebu/Kconfig | 1 +
> board/solidrun/clearfog/clearfog.c | 32 +++++++++++++++++++
> ...arfog_defconfig => clearfog_spi_defconfig} | 2 +-
> 4 files changed, 35 insertions(+), 1 deletion(-)
> copy configs/{clearfog_defconfig => clearfog_spi_defconfig} (98%)
>
Applied to u-boot-marvell/next
Thanks,
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v3 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt
@ 2023-03-27 10:31 Martin Rowe
0 siblings, 0 replies; 14+ messages in thread
From: Martin Rowe @ 2023-03-27 10:31 UTC (permalink / raw)
To: pali, sr; +Cc: josua, jon, mibodhi, u-boot, Martin Rowe
[upstream of vendor commit 19a96f7c40a8fc1d0a6546ac2418d966e5840a99]
The Clearfog devices have only one SDHC device. This is either eMMC if
it is populated on the SOM or SDHC if not. The Linux device tree assumes
the SDHC case. Detect if the device is an eMMC and fixup the device-tree
so it will be detected by Linux.
Ported from vendor repo at https://github.com/SolidRun/u-boot
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
---
Fixed spacing and removed __maybe_unused
arch/arm/mach-mvebu/Kconfig | 1 +
board/solidrun/clearfog/clearfog.c | 33 ++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 1f0dbef1c6..b1f2e97ae7 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -107,6 +107,7 @@ config TARGET_CLEARFOG
bool "Support ClearFog"
select 88F6820
select BOARD_LATE_INIT
+ select OF_BOARD_SETUP
config TARGET_HELIOS4
bool "Support Helios4"
diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index 03adb591d8..6edb422155 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -10,6 +10,7 @@
#include <miiphy.h>
#include <net.h>
#include <netdev.h>
+#include <mmc.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch/cpu.h>
@@ -261,3 +262,35 @@ int board_late_init(void)
return 0;
}
+
+static bool has_emmc(void)
+{
+ struct mmc *mmc;
+
+ mmc = find_mmc_device(0);
+ if (!mmc)
+ return 0;
+ return (!mmc_init(mmc) && IS_MMC(mmc)) ? true : false;
+}
+
+/*
+ * The Clearfog devices have only one SDHC device. This is either eMMC
+ * if it is populated on the SOM or SDHC if not. The Linux device tree
+ * assumes the SDHC case. Detect if the device is an eMMC and fixup the
+ * device-tree, so that it will be detected by Linux.
+ */
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+ int node;
+
+ if (has_emmc()) {
+ node = fdt_node_offset_by_compatible(blob, -1, "marvell,armada-380-sdhci");
+ if (node < 0)
+ return 0; /* Unexpected eMMC device; patching not supported */
+
+ puts("Patching FDT so that eMMC is detected by OS\n");
+ return fdt_setprop_empty(blob, node, "non-removable");
+ }
+
+ return 0;
+}
--
2.40.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2023-03-30 8:18 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 0:02 [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Martin Rowe
2023-03-25 0:02 ` [PATCH v2 1/3] arm: mvebu: clearfog: Fix MMC detection Martin Rowe
2023-03-27 7:00 ` Stefan Roese
2023-03-25 0:02 ` [PATCH v2 2/3] arm: mvebu: clearfog: Add defconfig for SPI booting Martin Rowe
2023-03-27 7:00 ` Stefan Roese
2023-03-25 0:02 ` [PATCH v2 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt Martin Rowe
2023-03-27 7:09 ` Stefan Roese
2023-03-27 10:34 ` Martin Rowe
2023-03-27 11:18 ` Pali Rohár
2023-03-27 11:24 ` [PATCH v3 " Martin Rowe
2023-03-30 4:58 ` Stefan Roese
2023-03-25 12:32 ` [PATCH v2 0/3] arm: mvebu: clearfog: defconfig and eMMC updates Pali Rohár
2023-03-30 8:18 ` Stefan Roese
2023-03-27 10:31 [PATCH v3 3/3] arm: mvebu: clearfog: Detect MMC vs SDHC and fixup fdt Martin Rowe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.