* [U-Boot] [PATCH v1 0/2] android: colibri_imx7: reserve DDR memory for Cortex-M4
@ 2019-07-12 10:50 Igor Opaniuk
2019-07-12 10:50 ` [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory Igor Opaniuk
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Igor Opaniuk @ 2019-07-12 10:50 UTC (permalink / raw)
To: u-boot
i.MX 7's Cortex-M4 core can run from DDR and uses DDR memory for
the rpmsg communication. Both use cases need a fixed location of
memory reserved. For the rpmsg use case the reserved area needs
to be in sync with the kernel's hardcoded vring descriptor location.
Introduce support for adding linux,usable-memory property to carve
out 1MB of memory in case the M4 core is running. Also make sure
that the i.MX 7 specific rpmsg driver does not get loaded in case
we do not carve out memory.
Igor Opaniuk (2):
common: fdt_support: add support for setting usable memory
board: colibri_imx7: reserve DDR memory for Cortex-M4
arch/arm/include/asm/mach-imx/sys_proto.h | 2 ++
board/toradex/colibri_imx7/colibri_imx7.c | 37 +++++++++++++++++++++++
common/fdt_support.c | 35 +++++++++++++++++++++
include/fdt_support.h | 2 ++
4 files changed, 76 insertions(+)
--
2.17.1
^ permalink raw reply [flat|nested] 12+ messages in thread* [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory 2019-07-12 10:50 [U-Boot] [PATCH v1 0/2] android: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk @ 2019-07-12 10:50 ` Igor Opaniuk 2019-07-12 11:14 ` Oleksandr Suvorov ` (2 more replies) 2019-07-12 10:50 ` [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk 2019-07-12 10:55 ` [U-Boot] [PATCH v1 0/2] android: " Igor Opaniuk 2 siblings, 3 replies; 12+ messages in thread From: Igor Opaniuk @ 2019-07-12 10:50 UTC (permalink / raw) To: u-boot From: Igor Opaniuk <igor.opaniuk@toradex.com> Add support for setting linux,usable-memory property in the memory node of device tree for the kernel [1]. This property holds a base address and size, describing a limited region in which memory may be considered available for use by the kernel. Memory outside of this range is not available for use. [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> --- common/fdt_support.c | 35 +++++++++++++++++++++++++++++++++++ include/fdt_support.h | 2 ++ 2 files changed, 37 insertions(+) diff --git a/common/fdt_support.c b/common/fdt_support.c index f31e9b0cc5..57413c7a4d 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -473,6 +473,41 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size) return fdt_fixup_memory_banks(blob, &start, &size, 1); } +int fdt_set_usable_memory(void *blob, u64 start[], u64 size[], int areas) +{ + int err, nodeoffset; + int len; + u8 tmp[8 * 16]; /* Up to 64-bit address + 64-bit size */ + + if (areas > 8) { + printf("%s: num areas %d exceeds hardcoded limit %d\n", + __func__, areas, 8); + return -1; + } + + err = fdt_check_header(blob); + if (err < 0) { + printf("%s: %s\n", __func__, fdt_strerror(err)); + return err; + } + + /* find or create "/memory" node. */ + nodeoffset = fdt_find_or_add_subnode(blob, 0, "memory"); + if (nodeoffset < 0) + return nodeoffset; + + len = fdt_pack_reg(blob, tmp, start, size, areas); + + err = fdt_setprop(blob, nodeoffset, "linux,usable-memory", tmp, len); + if (err < 0) { + printf("WARNING: could not set %s %s.\n", + "reg", fdt_strerror(err)); + return err; + } + + return 0; +} + void fdt_fixup_ethernet(void *fdt) { int i = 0, j, prop; diff --git a/include/fdt_support.h b/include/fdt_support.h index 27fe564f0b..a868b6710e 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -102,6 +102,8 @@ static inline int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], } #endif +int fdt_set_usable_memory(void *blob, u64 start[], u64 size[], int banks); + void fdt_fixup_ethernet(void *fdt); int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, const void *val, int len, int create); -- 2.17.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory 2019-07-12 10:50 ` [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory Igor Opaniuk @ 2019-07-12 11:14 ` Oleksandr Suvorov 2019-10-14 12:40 ` sbabic at denx.de [not found] ` <5da46cc1.1c69fb81.5f0ce.bea2SMTPIN_ADDED_MISSING@mx.google.com> 2 siblings, 0 replies; 12+ messages in thread From: Oleksandr Suvorov @ 2019-07-12 11:14 UTC (permalink / raw) To: u-boot On Fri, 12 Jul 2019 at 13:51, Igor Opaniuk <igor.opaniuk@gmail.com> wrote: > > From: Igor Opaniuk <igor.opaniuk@toradex.com> > > Add support for setting linux,usable-memory property in the memory > node of device tree for the kernel [1]. > > This property holds a base address and size, describing a > limited region in which memory may be considered available for use by > the kernel. Memory outside of this range is not available for use. > > [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt > > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> > Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> > --- > > common/fdt_support.c | 35 +++++++++++++++++++++++++++++++++++ > include/fdt_support.h | 2 ++ > 2 files changed, 37 insertions(+) > > diff --git a/common/fdt_support.c b/common/fdt_support.c > index f31e9b0cc5..57413c7a4d 100644 > --- a/common/fdt_support.c > +++ b/common/fdt_support.c > @@ -473,6 +473,41 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size) > return fdt_fixup_memory_banks(blob, &start, &size, 1); > } > > +int fdt_set_usable_memory(void *blob, u64 start[], u64 size[], int areas) > +{ > + int err, nodeoffset; > + int len; > + u8 tmp[8 * 16]; /* Up to 64-bit address + 64-bit size */ > + > + if (areas > 8) { > + printf("%s: num areas %d exceeds hardcoded limit %d\n", > + __func__, areas, 8); > + return -1; > + } > + > + err = fdt_check_header(blob); > + if (err < 0) { > + printf("%s: %s\n", __func__, fdt_strerror(err)); > + return err; > + } > + > + /* find or create "/memory" node. */ > + nodeoffset = fdt_find_or_add_subnode(blob, 0, "memory"); > + if (nodeoffset < 0) > + return nodeoffset; > + > + len = fdt_pack_reg(blob, tmp, start, size, areas); > + > + err = fdt_setprop(blob, nodeoffset, "linux,usable-memory", tmp, len); > + if (err < 0) { > + printf("WARNING: could not set %s %s.\n", > + "reg", fdt_strerror(err)); > + return err; > + } > + > + return 0; > +} > + > void fdt_fixup_ethernet(void *fdt) > { > int i = 0, j, prop; > diff --git a/include/fdt_support.h b/include/fdt_support.h > index 27fe564f0b..a868b6710e 100644 > --- a/include/fdt_support.h > +++ b/include/fdt_support.h > @@ -102,6 +102,8 @@ static inline int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], > } > #endif > > +int fdt_set_usable_memory(void *blob, u64 start[], u64 size[], int banks); > + > void fdt_fixup_ethernet(void *fdt); > int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, > const void *val, int len, int create); > -- > 2.17.1 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot -- Best regards Oleksandr Suvorov cryosay at gmail.com ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory 2019-07-12 10:50 ` [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory Igor Opaniuk 2019-07-12 11:14 ` Oleksandr Suvorov @ 2019-10-14 12:40 ` sbabic at denx.de [not found] ` <5da46cc1.1c69fb81.5f0ce.bea2SMTPIN_ADDED_MISSING@mx.google.com> 2 siblings, 0 replies; 12+ messages in thread From: sbabic at denx.de @ 2019-10-14 12:40 UTC (permalink / raw) To: u-boot > From: Igor Opaniuk <igor.opaniuk@toradex.com> > Add support for setting linux,usable-memory property in the memory > node of device tree for the kernel [1]. > This property holds a base address and size, describing a > limited region in which memory may be considered available for use by > the kernel. Memory outside of this range is not available for use. > [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> > Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> > Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <5da46cc1.1c69fb81.5f0ce.bea2SMTPIN_ADDED_MISSING@mx.google.com>]
* [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory [not found] ` <5da46cc1.1c69fb81.5f0ce.bea2SMTPIN_ADDED_MISSING@mx.google.com> @ 2019-11-28 15:23 ` Igor Opaniuk 2019-12-03 9:28 ` Stefano Babic 0 siblings, 1 reply; 12+ messages in thread From: Igor Opaniuk @ 2019-11-28 15:23 UTC (permalink / raw) To: u-boot Hi Stefano, On Mon, Oct 14, 2019 at 3:40 PM <sbabic@denx.de> wrote: > > > From: Igor Opaniuk <igor.opaniuk@toradex.com> > > Add support for setting linux,usable-memory property in the memory > > node of device tree for the kernel [1]. > > This property holds a base address and size, describing a > > limited region in which memory may be considered available for use by > > the kernel. Memory outside of this range is not available for use. > > [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt > > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > > Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> > > Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> > > Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> > > Applied to u-boot-imx, master, thanks ! Unfortunately I can't find this commit neither in u-boot-imx/next neither in u-boot-imx/master. > > Best regards, > Stefano Babic > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de > ===================================================================== > -- Best regards - Freundliche Grüsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory 2019-11-28 15:23 ` Igor Opaniuk @ 2019-12-03 9:28 ` Stefano Babic 2019-12-04 8:39 ` Igor Opaniuk 0 siblings, 1 reply; 12+ messages in thread From: Stefano Babic @ 2019-12-03 9:28 UTC (permalink / raw) To: u-boot Hi Igor, On 28/11/19 16:23, Igor Opaniuk wrote: > Hi Stefano, > > On Mon, Oct 14, 2019 at 3:40 PM <sbabic@denx.de> wrote: >> >>> From: Igor Opaniuk <igor.opaniuk@toradex.com> >>> Add support for setting linux,usable-memory property in the memory >>> node of device tree for the kernel [1]. >>> This property holds a base address and size, describing a >>> limited region in which memory may be considered available for use by >>> the kernel. Memory outside of this range is not available for use. >>> [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt >>> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> >>> Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> >>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> >>> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> >>> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> >> >> Applied to u-boot-imx, master, thanks ! > > Unfortunately I can't find this commit neither in u-boot-imx/next > neither in u-boot-imx/master. > Added again, and I have found that this breaks all boards where CONFIG_ARCH_FIXUP_FDT_MEMORY is not set. In fact, your new function calls fdt_pack_reg and this is not compiled if the define above is not set. Just ask if it does not make sense to let fdt_pack_reg() be always compiled... Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory 2019-12-03 9:28 ` Stefano Babic @ 2019-12-04 8:39 ` Igor Opaniuk 0 siblings, 0 replies; 12+ messages in thread From: Igor Opaniuk @ 2019-12-04 8:39 UTC (permalink / raw) To: u-boot Hi Stefano, On Tue, Dec 3, 2019 at 11:28 AM Stefano Babic <sbabic@denx.de> wrote: > > Hi Igor, > > On 28/11/19 16:23, Igor Opaniuk wrote: > > Hi Stefano, > > > > On Mon, Oct 14, 2019 at 3:40 PM <sbabic@denx.de> wrote: > >> > >>> From: Igor Opaniuk <igor.opaniuk@toradex.com> > >>> Add support for setting linux,usable-memory property in the memory > >>> node of device tree for the kernel [1]. > >>> This property holds a base address and size, describing a > >>> limited region in which memory may be considered available for use by > >>> the kernel. Memory outside of this range is not available for use. > >>> [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt > >>> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > >>> Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> > >>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > >>> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> > >>> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> > >> > >> Applied to u-boot-imx, master, thanks ! > > > > Unfortunately I can't find this commit neither in u-boot-imx/next > > neither in u-boot-imx/master. > > > > Added again, and I have found that this breaks all boards where > CONFIG_ARCH_FIXUP_FDT_MEMORY is not set. > > In fact, your new function calls fdt_pack_reg and this is not compiled > if the define above is not set. Just ask if it does not make sense to > let fdt_pack_reg() be always compiled... Thanks for reporting, the fix is here [1] [1] https://patchwork.ozlabs.org/project/uboot/list/?series=146241 > > Best regards, > Stefano Babic > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de > ===================================================================== -- Best regards - Freundliche Grüsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 2019-07-12 10:50 [U-Boot] [PATCH v1 0/2] android: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk 2019-07-12 10:50 ` [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory Igor Opaniuk @ 2019-07-12 10:50 ` Igor Opaniuk 2019-07-12 11:23 ` Oleksandr Suvorov ` (2 more replies) 2019-07-12 10:55 ` [U-Boot] [PATCH v1 0/2] android: " Igor Opaniuk 2 siblings, 3 replies; 12+ messages in thread From: Igor Opaniuk @ 2019-07-12 10:50 UTC (permalink / raw) To: u-boot From: Igor Opaniuk <igor.opaniuk@toradex.com> i.MX 7's Cortex-M4 core can run from DDR and uses DDR memory for the rpmsg communication. Both use cases need a fixed location of memory reserved. For the rpmsg use case the reserved area needs to be in sync with the kernel's hardcoded vring descriptor location. Use the linux,usable-memory property to carve out 1MB of memory in case the M4 core is running. Also make sure that the i.MX 7 specific rpmsg driver does not get loaded in case we do not carve out memory. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> --- arch/arm/include/asm/mach-imx/sys_proto.h | 2 ++ board/toradex/colibri_imx7/colibri_imx7.c | 37 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 4925dd7894..775cd3df40 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -113,6 +113,8 @@ void init_src(void); void init_snvs(void); void imx_wdog_disable_powerdown(void); +int arch_auxiliary_core_check_up(u32 core_id); + int board_mmc_get_env_dev(int devno); int nxp_board_rev(void); diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 0eb83474c4..6059088bda 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -333,6 +333,43 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { +#if defined(CONFIG_IMX_BOOTAUX) + int up; + + up = arch_auxiliary_core_check_up(0); + if (up) { + int ret; + int areas = 1; + u64 start[2], size[2]; + + /* + * Reserve 1MB of memory for M4 (1MiB is also the minimum + * alignment for Linux due to MMU section size restrictions). + */ + start[0] = gd->bd->bi_dram[0].start; + size[0] = SZ_256M - SZ_1M; + + /* If needed, create a second entry for memory beyond 256M */ + if (gd->bd->bi_dram[0].size > SZ_256M) { + start[1] = gd->bd->bi_dram[0].start + SZ_256M; + size[1] = gd->bd->bi_dram[0].size - SZ_256M; + areas = 2; + } + + ret = fdt_set_usable_memory(blob, start, size, areas); + if (ret) { + eprintf("Cannot set usable memory\n"); + return ret; + } + } else { + int off; + + off = fdt_node_offset_by_compatible(blob, -1, + "fsl,imx7d-rpmsg"); + if (off > 0) + fdt_status_disabled(blob, off); + } +#endif #if defined(CONFIG_FDT_FIXUP_PARTITIONS) static const struct node_info nodes[] = { { "fsl,imx7d-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ -- 2.17.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 2019-07-12 10:50 ` [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk @ 2019-07-12 11:23 ` Oleksandr Suvorov 2019-10-14 12:40 ` sbabic at denx.de [not found] ` <5da46cd0.1c69fb81.5d82a.9621SMTPIN_ADDED_MISSING@mx.google.com> 2 siblings, 0 replies; 12+ messages in thread From: Oleksandr Suvorov @ 2019-07-12 11:23 UTC (permalink / raw) To: u-boot On Fri, 12 Jul 2019 at 13:50, Igor Opaniuk <igor.opaniuk@gmail.com> wrote: > > From: Igor Opaniuk <igor.opaniuk@toradex.com> > > i.MX 7's Cortex-M4 core can run from DDR and uses DDR memory for > the rpmsg communication. Both use cases need a fixed location of > memory reserved. For the rpmsg use case the reserved area needs > to be in sync with the kernel's hardcoded vring descriptor location. > > Use the linux,usable-memory property to carve out 1MB of memory > in case the M4 core is running. Also make sure that the i.MX 7 > specific rpmsg driver does not get loaded in case we do not carve > out memory. > > Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> > --- > > arch/arm/include/asm/mach-imx/sys_proto.h | 2 ++ > board/toradex/colibri_imx7/colibri_imx7.c | 37 +++++++++++++++++++++++ > 2 files changed, 39 insertions(+) > > diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h > index 4925dd7894..775cd3df40 100644 > --- a/arch/arm/include/asm/mach-imx/sys_proto.h > +++ b/arch/arm/include/asm/mach-imx/sys_proto.h > @@ -113,6 +113,8 @@ void init_src(void); > void init_snvs(void); > void imx_wdog_disable_powerdown(void); > > +int arch_auxiliary_core_check_up(u32 core_id); > + > int board_mmc_get_env_dev(int devno); > > int nxp_board_rev(void); > diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c > index 0eb83474c4..6059088bda 100644 > --- a/board/toradex/colibri_imx7/colibri_imx7.c > +++ b/board/toradex/colibri_imx7/colibri_imx7.c > @@ -333,6 +333,43 @@ int checkboard(void) > #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) > int ft_board_setup(void *blob, bd_t *bd) > { > +#if defined(CONFIG_IMX_BOOTAUX) > + int up; > + > + up = arch_auxiliary_core_check_up(0); > + if (up) { > + int ret; > + int areas = 1; > + u64 start[2], size[2]; > + > + /* > + * Reserve 1MB of memory for M4 (1MiB is also the minimum > + * alignment for Linux due to MMU section size restrictions). > + */ > + start[0] = gd->bd->bi_dram[0].start; > + size[0] = SZ_256M - SZ_1M; > + > + /* If needed, create a second entry for memory beyond 256M */ > + if (gd->bd->bi_dram[0].size > SZ_256M) { > + start[1] = gd->bd->bi_dram[0].start + SZ_256M; > + size[1] = gd->bd->bi_dram[0].size - SZ_256M; > + areas = 2; > + } > + > + ret = fdt_set_usable_memory(blob, start, size, areas); > + if (ret) { > + eprintf("Cannot set usable memory\n"); > + return ret; > + } > + } else { > + int off; > + > + off = fdt_node_offset_by_compatible(blob, -1, > + "fsl,imx7d-rpmsg"); > + if (off > 0) > + fdt_status_disabled(blob, off); > + } > +#endif > #if defined(CONFIG_FDT_FIXUP_PARTITIONS) > static const struct node_info nodes[] = { > { "fsl,imx7d-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ > -- > 2.17.1 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot -- Best regards Oleksandr Suvorov Toradex AG Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500 4800 (main line) ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 2019-07-12 10:50 ` [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk 2019-07-12 11:23 ` Oleksandr Suvorov @ 2019-10-14 12:40 ` sbabic at denx.de [not found] ` <5da46cd0.1c69fb81.5d82a.9621SMTPIN_ADDED_MISSING@mx.google.com> 2 siblings, 0 replies; 12+ messages in thread From: sbabic at denx.de @ 2019-10-14 12:40 UTC (permalink / raw) To: u-boot > From: Igor Opaniuk <igor.opaniuk@toradex.com> > i.MX 7's Cortex-M4 core can run from DDR and uses DDR memory for > the rpmsg communication. Both use cases need a fixed location of > memory reserved. For the rpmsg use case the reserved area needs > to be in sync with the kernel's hardcoded vring descriptor location. > Use the linux,usable-memory property to carve out 1MB of memory > in case the M4 core is running. Also make sure that the i.MX 7 > specific rpmsg driver does not get loaded in case we do not carve > out memory. > Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> > Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <5da46cd0.1c69fb81.5d82a.9621SMTPIN_ADDED_MISSING@mx.google.com>]
* [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 [not found] ` <5da46cd0.1c69fb81.5d82a.9621SMTPIN_ADDED_MISSING@mx.google.com> @ 2019-11-28 15:21 ` Igor Opaniuk 0 siblings, 0 replies; 12+ messages in thread From: Igor Opaniuk @ 2019-11-28 15:21 UTC (permalink / raw) To: u-boot Hi Stefano, On Mon, Oct 14, 2019 at 3:40 PM <sbabic@denx.de> wrote: > > > From: Igor Opaniuk <igor.opaniuk@toradex.com> > > i.MX 7's Cortex-M4 core can run from DDR and uses DDR memory for > > the rpmsg communication. Both use cases need a fixed location of > > memory reserved. For the rpmsg use case the reserved area needs > > to be in sync with the kernel's hardcoded vring descriptor location. > > Use the linux,usable-memory property to carve out 1MB of memory > > in case the M4 core is running. Also make sure that the i.MX 7 > > specific rpmsg driver does not get loaded in case we do not carve > > out memory. > > Signed-off-by: Stefan Agner <stefan.agner@toradex.com> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> > > Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> > > Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> > > Applied to u-boot-imx, master, thanks ! Unfortunately I can't find this commit neither in u-boot-imx/next neither in u-boot-imx/master. > > Best regards, > Stefano Babic > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de > ===================================================================== > -- Best regards - Freundliche Grüsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v1 0/2] android: colibri_imx7: reserve DDR memory for Cortex-M4 2019-07-12 10:50 [U-Boot] [PATCH v1 0/2] android: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk 2019-07-12 10:50 ` [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory Igor Opaniuk 2019-07-12 10:50 ` [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk @ 2019-07-12 10:55 ` Igor Opaniuk 2 siblings, 0 replies; 12+ messages in thread From: Igor Opaniuk @ 2019-07-12 10:55 UTC (permalink / raw) To: u-boot On Fri, Jul 12, 2019 at 1:50 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote: > > i.MX 7's Cortex-M4 core can run from DDR and uses DDR memory for > the rpmsg communication. Both use cases need a fixed location of > memory reserved. For the rpmsg use case the reserved area needs > to be in sync with the kernel's hardcoded vring descriptor location. > > Introduce support for adding linux,usable-memory property to carve > out 1MB of memory in case the M4 core is running. Also make sure > that the i.MX 7 specific rpmsg driver does not get loaded in case > we do not carve out memory. > > Igor Opaniuk (2): > common: fdt_support: add support for setting usable memory > board: colibri_imx7: reserve DDR memory for Cortex-M4 > > arch/arm/include/asm/mach-imx/sys_proto.h | 2 ++ > board/toradex/colibri_imx7/colibri_imx7.c | 37 +++++++++++++++++++++++ > common/fdt_support.c | 35 +++++++++++++++++++++ > include/fdt_support.h | 2 ++ > 4 files changed, 76 insertions(+) > > -- > 2.17.1 > Please, don't pay attention to "android" keyword in the title (actually nothing related to android), it's just a glitch. -- Best regards - Freundliche Grüsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2019-12-04 8:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-12 10:50 [U-Boot] [PATCH v1 0/2] android: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk
2019-07-12 10:50 ` [U-Boot] [PATCH v1 1/2] common: fdt_support: add support for setting usable memory Igor Opaniuk
2019-07-12 11:14 ` Oleksandr Suvorov
2019-10-14 12:40 ` sbabic at denx.de
[not found] ` <5da46cc1.1c69fb81.5f0ce.bea2SMTPIN_ADDED_MISSING@mx.google.com>
2019-11-28 15:23 ` Igor Opaniuk
2019-12-03 9:28 ` Stefano Babic
2019-12-04 8:39 ` Igor Opaniuk
2019-07-12 10:50 ` [U-Boot] [PATCH v1 2/2] board: colibri_imx7: reserve DDR memory for Cortex-M4 Igor Opaniuk
2019-07-12 11:23 ` Oleksandr Suvorov
2019-10-14 12:40 ` sbabic at denx.de
[not found] ` <5da46cd0.1c69fb81.5d82a.9621SMTPIN_ADDED_MISSING@mx.google.com>
2019-11-28 15:21 ` Igor Opaniuk
2019-07-12 10:55 ` [U-Boot] [PATCH v1 0/2] android: " Igor Opaniuk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox