From: Grygorii Strashko Date: Fri, 24 Jul 2020 15:25:33 +0300 Subject: [PATCH 07/18] arm: mach-k3: j721e: Add detection for j721e In-Reply-To: <20200723084718.19430-8-lokeshvutla@ti.com> References: <20200723084718.19430-1-lokeshvutla@ti.com> <20200723084718.19430-8-lokeshvutla@ti.com> Message-ID: <0ddf0d4a-e177-9982-bb94-91bea8e7ed1d@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 23/07/2020 11:47, Lokesh Vutla wrote: > Add an api soc_is_j721e(), and use it to enable certain functionality > that is available only on j721e. > > Signed-off-by: Lokesh Vutla > Signed-off-by: Suman Anna > --- > arch/arm/mach-k3/common.c | 10 ++++++++++ > arch/arm/mach-k3/include/mach/sys_proto.h | 2 ++ > arch/arm/mach-k3/j721e_init.c | 3 +++ > 3 files changed, 15 insertions(+) > > diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c > index eb72451d06..aec6c600b9 100644 > --- a/arch/arm/mach-k3/common.c > +++ b/arch/arm/mach-k3/common.c > @@ -355,6 +355,16 @@ int print_cpuinfo(void) > } > #endif > > +bool soc_is_j721e(void) > +{ > + u32 soc; > + > + soc = (readl(CTRLMMR_WKUP_JTAG_ID) & > + JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; > + > + return soc == J721E; > +} Shouldn't it be done using UCLASS_SOC introduce by Dave Gerlach https://patchwork.ozlabs.org/project/uboot/cover/20200716044004.6014-1-d-gerlach at ti.com/ > + > #ifdef CONFIG_ARM64 > void board_prep_linux(bootm_headers_t *images) > { > diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h > index 3c825aa3d1..48b11178c3 100644 > --- a/arch/arm/mach-k3/include/mach/sys_proto.h > +++ b/arch/arm/mach-k3/include/mach/sys_proto.h > @@ -16,4 +16,6 @@ int do_board_detect(void); > void release_resources_for_core_shutdown(void); > int fdt_disable_node(void *blob, char *node_path); > > +bool soc_is_j721e(void); > + > #endif > diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c > index 461a9d7f8f..3b15da2d7c 100644 > --- a/arch/arm/mach-k3/j721e_init.c > +++ b/arch/arm/mach-k3/j721e_init.c > @@ -361,6 +361,9 @@ void start_non_linux_remote_cores(void) > int size = 0, ret; > u32 loadaddr = 0; > > + if (!soc_is_j721e()) > + return; > + > size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load", > &loadaddr); > if (size <= 0) > -- Best regards, grygorii