imx: imx7d: add imx-common cpu support for imx7d
Subsystems (3)
PATCH v6 1/1 imx: imx7d: add imx-common cpu support for imx7d
Add imx-common cpu support for imx7d SoC
- Update reset_cause for imx7d
- Enable watchdog driver built for imx7d
---
Changes for V2: Split patch to easier review process
- Add system arch register definitions Changes for V3: Resend
Changes for V4: Resend
Changes for V5: Resend
Changes for V6:
- Rework imx-common Makefile mx7 build options
- Remove mx6 CONFIG_GPT_TIMER as is the default option
arch/arm/Makefile | 4 ++-- arch/arm/cpu/armv7/Makefile | 3 ++- arch/arm/cpu/armv7/mx7/Makefile | 8 ++++++++ arch/arm/imx-common/Makefile | 10 ++++++++-- arch/arm/imx-common/cpu.c | 17 +++++++++++++++++ drivers/watchdog/Makefile | 2 +- 6 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 arch/arm/cpu/armv7/mx7/Makefile
arch/arm/Makefile +2 -2
@@ -79,11 +79,11 @@ libs-y += arch/arm/cpu/ libs-y += arch/arm/lib/ ifeq ($(CONFIG_SPL_BUILD),y) -ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx31 mx35)) libs-y += arch/arm/imx-common/ endif else -ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx31 mx35 mxs vf610)) libs-y += arch/arm/imx-common/ endif endif
arch/arm/cpu/armv7/Makefile +2 -1
@@ -12,7 +12,7 @@ obj-y += cache_v7.o obj-y += cpu.o cp15.o obj-y += syslib.o -ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA),) +ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA),) ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y) obj-y += lowlevel_init.o endif
@@ -44,6 +44,7 @@ obj-$(if $(filter bcmnsp,$(SOC)),y) += bcmnsp/ obj-$(if $(filter ls102xa,$(SOC)),y) += ls102xa/ obj-$(if $(filter mx5,$(SOC)),y) += mx5/ obj-$(CONFIG_MX6) += mx6/ +obj-$(CONFIG_MX7) += mx7/ obj-$(CONFIG_OMAP34XX) += omap3/ obj-$(CONFIG_OMAP44XX) += omap4/ obj-$(CONFIG_OMAP54XX) += omap5/
arch/arm/cpu/armv7/mx7/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# (C) Copyright 2015 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# +# + +obj-y := soc.o clock.o clock_slice.o
arch/arm/imx-common/Makefile +8 -2
@@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610)) +ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 vf610)) obj-y = iomux-v3.o endif ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
@@ -18,7 +18,13 @@ ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) obj-y += misc.o obj-$(CONFIG_SPL_BUILD) += spl.o endif -ifeq ($(SOC),$(filter $(SOC),mx6)) +ifeq ($(SOC),$(filter $(SOC),mx7)) +obj-y += cpu.o +obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o +obj-$(CONFIG_GPT_TIMER) += timer.o +obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o +endif +ifeq ($(SOC),$(filter $(SOC),mx6 mx7)) obj-y += cache.o init.o obj-$(CONFIG_CMD_SATA) += sata.o obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
arch/arm/imx-common/cpu.c +17 -0
@@ -46,13 +46,26 @@ static char *get_reset_cause(void)case 0x00008 :return "IPP USER" ;case 0x00010 : +#ifdef CONFIG_MX7 +return "WDOG1" ; +#else return "WDOG" ; +#endif case 0x00020 :return "JTAG HIGH-Z" ;case 0x00040 :return "JTAG SW" ; +#ifdef CONFIG_MX7 +case 0x00080 : +return "WDOG3" ; +case 0x00100 : +return "WDOG4" ; +case 0x00200 : +return "TEMPSENSE" ; +#else case 0x10000 :return "WARM BOOT" ; +#endif default :return "unknown reset" ; }
@@ -122,6 +135,8 @@ unsigned imx_ddr_size(void)const char *get_imx_type (u32 imxtype) {switch (imxtype) { +case MXC_CPU_MX7D : +return "7D" ;/* Dual-core version of the mx7 */ case MXC_CPU_MX6QP :return "6QP" ;/* Quad-Plus version of the mx6 */ case MXC_CPU_MX6DP :
@@ -237,6 +252,7 @@ int cpu_mmc_init(bd_t *bis) }#endif +#ifndef CONFIG_MX7 u32 get_ahb_clk (void ) {struct mxc_ccm_reg *imx_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR ;
@@ -248,6 +264,7 @@ u32 get_ahb_clk(void) return get_periph_clk() / (ahb_podf + 1); } +#endif void arch_preboot_os (void ) {
drivers/watchdog/Makefile +1 -1
@@ -7,7 +7,7 @@ obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o -ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 vf610 ls102xa)) +ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa)) obj-y += imx_watchdog.o endif obj-$(CONFIG_S5P) += s5p_wdt.o
Signature · 1 line
2.1.4
PATCH v6 1/1 imx: imx7d: add imx-common cpu support for imx7d
Hi Adrian,
Quoted 122 lines · Adrian Alonso
Add imx-common cpu support for imx7d SoC
- Updatereset_causefor imx7d
- Enable watchdog driver built for imx7dSigned-off-by Adrian Alonso <[email protected]>Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>---
Changes for V2: Split patch to easier review process
- Add system arch register definitions Changes for V3: Resend
Changes for V4: Resend
Changes for V5: Resend
Changes for V6:
- Rework imx-commonMakefilemx7 build options
- Remove mx6CONFIG_GPT_TIMERas is the default optionarch/arm/Makefile | 4 ++-- arch/arm/cpu/armv7/Makefile | 3 ++- arch/arm/cpu/armv7/mx7/Makefile | 8 ++++++++ arch/arm/imx-common/Makefile | 10 ++++++++-- arch/arm/imx-common/cpu.c | 17 +++++++++++++++++ drivers/watchdog/Makefile | 2 +- 6 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 arch/arm/cpu/armv7/mx7/Makefilearch/arm/Makefile +2
-2@@ -79,11 +79,11 @@ libs-y += arch/arm/cpu/ libs-y += arch/arm/lib/ ifeq ($(CONFIG_SPL_BUILD),y) -ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx31 mx35)) libs-y += arch/arm/imx-common/ endif else -ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx31 mx35 mxs vf610)) libs-y += arch/arm/imx-common/ endif endifarch/arm/cpu/armv7/Makefile +2
-1@@ -12,7 +12,7 @@ obj-y += cache_v7.o obj-y += cpu.o cp15.o obj-y += syslib.o -ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA),) +ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_MX7)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_ARCH_SOCFPGA),) ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y) obj-y += lowlevel_init.o endif@@ -44,6 +44,7 @@ obj-$(if $(filter bcmnsp,$(SOC)),y) += bcmnsp/ obj-$(if $(filter ls102xa,$(SOC)),y) += ls102xa/ obj-$(if $(filter mx5,$(SOC)),y) += mx5/ obj-$(CONFIG_MX6) += mx6/ +obj-$(CONFIG_MX7) += mx7/ obj-$(CONFIG_OMAP34XX) += omap3/ obj-$(CONFIG_OMAP44XX) += omap4/ obj-$(CONFIG_OMAP54XX) += omap5/arch/arm/cpu/armv7/mx7/Makefile new file +8
-0@@ -0,0 +1,8 @@ +# +# (C) Copyright 2015 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# +# + +obj-y := soc.o clock.o clock_slice.oarch/arm/imx-common/Makefile +8
-2@@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610)) +ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 vf610)) obj-y = iomux-v3.o endif ifeq ($(SOC),$(filter $(SOC),mx5 mx6))@@ -18,7 +18,13 @@ ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) obj-y += misc.o obj-$(CONFIG_SPL_BUILD) += spl.o endif -ifeq ($(SOC),$(filter $(SOC),mx6)) +ifeq ($(SOC),$(filter $(SOC),mx7)) +obj-y += cpu.o +obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o +obj-$(CONFIG_GPT_TIMER) += timer.o +obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o +endif +ifeq ($(SOC),$(filter $(SOC),mx6 mx7)) obj-y += cache.o init.o obj-$(CONFIG_CMD_SATA) += sata.o obj-$(CONFIG_IMX_VIDEO_SKIP) += video.oarch/arm/imx-common/cpu.c +4
-0@@ -46,13 +46,26 @@ static char *get_reset_cause(void)case 0x00008 :return "IPP USER" ;case 0x00010 : +#ifdef CONFIG_MX7 +return "WDOG1" ; +#else return "WDOG" ; +#endif case 0x00020 :return "JTAG HIGH-Z" ;
arch/arm/imx-common/cpu.c static char *get_reset_cause(void) · line 65
Quoted 10 lines
arch/arm/imx-common/cpu.c +8
-0case 0x00040 :return "JTAG SW" ; +#ifdef CONFIG_MX7 +case 0x00080 : +return "WDOG3" ; +case 0x00100 : +return "WDOG4" ; +case 0x00200 : +return "TEMPSENSE" ; +#else
As MX7 returns other causes, do we need the #ifdef ? I do not see conflicts with the current ones.
Quoted 37 lines
arch/arm/imx-common/cpu.c +5
-0case 0x10000 :return "WARM BOOT" ; +#endif default :return "unknown reset" ; }@@ -122,6 +135,8 @@ unsigned imx_ddr_size(void)const char *get_imx_type (u32 imxtype) {switch (imxtype) { +case MXC_CPU_MX7D : +return "7D" ;/* Dual-core version of the mx7 */ case MXC_CPU_MX6QP :return "6QP" ;/* Quad-Plus version of the mx6 */ case MXC_CPU_MX6DP :@@ -237,6 +252,7 @@ int cpu_mmc_init(bd_t *bis) }#endif +#ifndef CONFIG_MX7 u32 get_ahb_clk (void ) {struct mxc_ccm_reg *imx_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR ;@@ -248,6 +264,7 @@ u32 get_ahb_clk(void) return get_periph_clk() / (ahb_podf + 1); } +#endif void arch_preboot_os (void ) {drivers/watchdog/Makefile +0
-0
drivers/watchdog/Makefile line 13
Quoted 8 lines
drivers/watchdog/Makefile +1
-1@@ -7,7 +7,7 @@ obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o -ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 vf610 ls102xa)) +ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 mx7 vf610 ls102xa)) obj-y += imx_watchdog.o endif obj-$(CONFIG_S5P) += s5p_wdt.o
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================