Skip to contentSkip to conversation

Convert CONFIG_SOC_DA8XX et al to Kconfig

PATCH Superseded Adam Ford 2 participants 7 messages Jan 2, 2018

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

This converts the following to Kconfig:
CONFIG_SOC_DA8XX
CONFIG_SOC_DA850
CONFIG_DA850_LOWLEVEL
CONFIG_MACH_DAVINCI_DA850_EVM
CONFIG_SYS_DA850_PLL_INIT
CONFIG_SYS_DA850_DDR_INIT

---
Changes in V4:
Rebase against origin/master

Changes in V3:
Add bool for DA850_LOWLEVEL and make it select DA850_PLL_INIT and
DA850_DDR_INIT
Make OMAPL138_LCDK select SOC_DA8XX instead of SOC_DA850. The name of
CONFIG_SOC_DA8XX was left alone here since it wasn't my goal to change the naming convention.
WhileDA850 is probably correct, it would technically be a change to the
compiled code and that wasn't the goal here.

 README                                |  2 --
 arch/arm/mach-davinci/Kconfig         | 36 +++++++++++++++++++++++++----------
 configs/calimain_defconfig            |  1 +
 configs/da850evm_direct_nor_defconfig |  1 +
 include/configs/calimain.h            |  3 ---
 include/configs/da850evm.h            |  4 ----
 include/configs/ea20.h                |  3 ---
 include/configs/ipam390.h             |  3 ---
 include/configs/legoev3.h             |  3 ---
 include/configs/omapl138_lcdk.h       |  1 -
 scripts/config_whitelist.txt          |  4 ----
 11 files changed, 28 insertions(+), 33 deletions(-)
README +0 -2
index 06f3ed0..ea7923e 100644
@@ -2351,8 +2351,6 @@ The following options need to be configured:
 
 		CONFIG_AT91SAM9XE
 		enable special bootcounter support on at91sam9xe based boards.
-		CONFIG_SOC_DA8XX
-		enable special bootcounter support on da850 based boards.
 		CONFIG_BOOTCOUNT_RAM
 		enable support for the bootcounter in RAM
 		CONFIG_BOOTCOUNT_I2C
arch/arm/mach-davinci/Kconfig +26 -10
index 35e4e9b..0dc850e 100644
@@ -6,47 +6,63 @@ choice
 
 config TARGET_IPAM390
 	bool "IPAM390 board"
+	select MACH_DAVINCI_DA850_EVM
+	select SOC_DA850
 	select SUPPORT_SPL
-	select SYS_DA850_PLL_INIT
-	select SYS_DA850_DDR_INIT
 
 config TARGET_DA850EVM
 	bool "DA850 EVM board"
+	select MACH_DAVINCI_DA850_EVM
+	select SOC_DA850
 	select SUPPORT_SPL
-	select SYS_DA850_PLL_INIT
-	select SYS_DA850_DDR_INIT
 
 config TARGET_EA20
 	bool "EA20 board"
+	select MACH_DAVINCI_DA850_EVM
+	select SOC_DA850
 	select BOARD_LATE_INIT
 
 config TARGET_OMAPL138_LCDK
 	bool "OMAPL138 LCDK"
+	select SOC_DA8XX
 	select SUPPORT_SPL
-	select SYS_DA850_PLL_INIT
-	select SYS_DA850_DDR_INIT
 
 config TARGET_CALIMAIN
 	bool "Calimain board"
-	select SYS_DA850_PLL_INIT
-	select SYS_DA850_DDR_INIT
+	select SOC_DA850
 
 config TARGET_LEGOEV3
 	bool "LEGO MINDSTORMS EV3"
-	select SYS_DA850_PLL_INIT
-	select SYS_DA850_DDR_INIT
+	select MACH_DAVINCI_DA850_EVM
+	select SOC_DA850
 
 endchoice
 
 config SYS_SOC
 	default "davinci"
 
+config DA850_LOWLEVEL
+	bool "Enable Lowlevel DA850 initialization"
+	depends on SOC_DA850
+	select SYS_DA850_PLL_INIT
+	select SYS_DA850_DDR_INIT
+
 config SYS_DA850_PLL_INIT
 	bool
 
 config SYS_DA850_DDR_INIT
 	bool
 
+config SOC_DA850
+	bool
+	select SOC_DA8XX
+
+config SOC_DA8XX
+	bool
+
+config MACH_DAVINCI_DA850_EVM
+	bool
+
 source "board/Barix/ipam390/Kconfig"
 source "board/davinci/da8xxevm/Kconfig"
 source "board/davinci/ea20/Kconfig"
configs/calimain_defconfig +1 -0
index a02926c..d8ab012 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_CALIMAIN=y
+CONFIG_DA850_LOWLEVEL=y
 CONFIG_BOOTDELAY=0
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
configs/da850evm_direct_nor_defconfig +1 -0
index b00eea7..19e7244 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
+CONFIG_DA850_LOWLEVEL=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
 # CONFIG_SYS_MALLOC_F is not set
include/configs/calimain.h +0 -3
index 60068d1..a24eff0 100644
@@ -22,15 +22,12 @@
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_CALIMAIN
-#define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
-#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		calimain_get_osc_freq()
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
 #define CONFIG_SYS_HZ_CLOCK		clk_get(DAVINCI_AUXCLK_CLKID)
 #define CONFIG_SYS_TEXT_BASE		0x60000000
-#define CONFIG_DA850_LOWLEVEL
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_DA8XX_GPIO
 #define CONFIG_HW_WATCHDOG
include/configs/da850evm.h +0 -4
index 4364649..5159a6f 100644
@@ -33,9 +33,6 @@
 /*
  * SoC Configuration
  */
-#define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
-#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
@@ -47,7 +44,6 @@
 #define CONFIG_DA8XX_GPIO
 #define CONFIG_SYS_TEXT_BASE		0x60000000
 #define CONFIG_SYS_DV_NOR_BOOT_CFG	(0x11)
-#define CONFIG_DA850_LOWLEVEL
 #else
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
 #endif
include/configs/ea20.h +0 -3
index c5e6e9e..9b5856e 100644
@@ -24,9 +24,6 @@
 /*
  * SoC Configuration
  */
-#define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
-#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
include/configs/ipam390.h +0 -3
index 1683855..618bf72 100644
@@ -24,9 +24,6 @@
 /*
  * SoC Configuration
  */
-#define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
-#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
include/configs/legoev3.h +0 -3
index c27373c..105429b 100644
@@ -18,9 +18,6 @@
 /*
  * SoC Configuration
  */
-#define CONFIG_MACH_DAVINCI_DA850_EVM
-#define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
-#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
include/configs/omapl138_lcdk.h +0 -1
index 5dba7d2..570322e 100644
@@ -24,7 +24,6 @@
  */
 #define CONFIG_MACH_OMAPL138_LCDK
 #define CONFIG_ARM926EJS		/* arm926ejs CPU core */
-#define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
scripts/config_whitelist.txt +0 -4
index 43a4ff0..f11a0a7 100644
@@ -351,7 +351,6 @@ CONFIG_CYRUS
 CONFIG_D2NET_V2
 CONFIG_DA850_AM18X_EVM
 CONFIG_DA850_EVM_MAX_CPU_CLK
-CONFIG_DA850_LOWLEVEL
 CONFIG_DA8XX_GPIO
 CONFIG_DAVINCI_SPI
 CONFIG_DBAU1000
@@ -1295,7 +1294,6 @@ CONFIG_MACB3_PHY
 CONFIG_MACB_SEARCH_PHY
 CONFIG_MACH_ASPENITE
 CONFIG_MACH_DAVINCI_CALIMAIN
-CONFIG_MACH_DAVINCI_DA850_EVM
 CONFIG_MACH_DOCKSTAR
 CONFIG_MACH_EDMINIV2
 CONFIG_MACH_GOFLEXHOME
@@ -2021,8 +2019,6 @@ CONFIG_SOC_AU1100
 CONFIG_SOC_AU1500
 CONFIG_SOC_AU1550
 CONFIG_SOC_AU1X00
-CONFIG_SOC_DA850
-CONFIG_SOC_DA8XX
 CONFIG_SOC_DM355
 CONFIG_SOC_DM365
 CONFIG_SOC_DM644X
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

Quoted 8 lines · Adam Ford

This converts the following to Kconfig:

    CONFIG_SOC_DA8XX
    CONFIG_SOC_DA850
    CONFIG_DA850_LOWLEVEL
    CONFIG_MACH_DAVINCI_DA850_EVM
    CONFIG_SYS_DA850_PLL_INIT
    CONFIG_SYS_DA850_DDR_INIT
Quoted 8 lines

---
Changes in V4:
Rebase against origin/master

Changes in V3:

	Add bool for DA850_LOWLEVEL and make it select DA850_PLL_INIT and
	  DA850_DDR_INIT

It looks like da850_lowlevel.o is also compiled when CONFIG_SPL_BUILD and CONFIG_SOC_DA8XX are both defined, so this change will most likely break SPL builds. So, probably best to just leave DA850_PLL_INIT and DA850_DDR_INIT alone for now.

Quoted 6 lines

Make OMAPL138_LCDK select SOC_DA8XX instead of SOC_DA850. The name of
CONFIG_SOC_DA8XX was left alone here since it wasn't my goal to change the naming convention.
WhileDA850 is probably correct, it would technically be a change to the
compiled code and that wasn't the goal here.

author
#2 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

Quoted 20 lines · David Lechner
Quoted 9 lines · Adam Ford

This converts the following to Kconfig:

    CONFIG_SOC_DA8XX
    CONFIG_SOC_DA850
    CONFIG_DA850_LOWLEVEL
    CONFIG_MACH_DAVINCI_DA850_EVM
    CONFIG_SYS_DA850_PLL_INIT
    CONFIG_SYS_DA850_DDR_INIT
Quoted 8 lines

---
Changes in V4:
Rebase against origin/master

Changes in V3:
Add bool for DA850_LOWLEVEL and make it select DA850_PLL_INIT and
DA850_DDR_INIT

Quoted 5 lines

It looks like da850_lowlevel.o is also compiled when CONFIG_SPL_BUILD and CONFIG_SOC_DA8XX are both defined, so this change will most likely break SPL builds. So, probably best to just leave DA850_PLL_INIT and DA850_DDR_INIT alone for now.

Any objections to keeping the migration of DA850_PLL_INIT and DA850_DDR_INIT if I change the dependencies to set both of them when either DA850_LOWLEVEL or SPL is defined?

adam

Quoted 11 lines
Quoted 10 lines

Make OMAPL138_LCDK select SOC_DA8XX instead of SOC_DA850. The
name of
CONFIG_SOC_DA8XX was left alone here since it wasn't my goal to
change
the naming convention.
WhileDA850 is probably correct, it would technically be a change
to the
compiled code and that wasn't the goal here.

#3 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

Quoted 27 lines · Adam Ford
Quoted 20 lines · David Lechner
Quoted 9 lines · Adam Ford

This converts the following to Kconfig:

     CONFIG_SOC_DA8XX
     CONFIG_SOC_DA850
     CONFIG_DA850_LOWLEVEL
     CONFIG_MACH_DAVINCI_DA850_EVM
     CONFIG_SYS_DA850_PLL_INIT
     CONFIG_SYS_DA850_DDR_INIT
Quoted 8 lines

---
Changes in V4:
Rebase against origin/master

Changes in V3:
Add bool for DA850_LOWLEVEL and make it select DA850_PLL_INIT and
DA850_DDR_INIT

Quoted 5 lines

It looks like da850_lowlevel.o is also compiled when CONFIG_SPL_BUILD and CONFIG_SOC_DA8XX are both defined, so this change will most likely break SPL builds. So, probably best to just leave DA850_PLL_INIT and DA850_DDR_INIT alone for now.

Quoted 3 lines

Any objections to keeping the migration of DA850_PLL_INIT and DA850_DDR_INIT if I change the dependencies to set both of them when either DA850_LOWLEVEL or SPL is defined?

Wouldn't that change the EA20 board since it currently does not select DA850_PLL_INIT or DA850_DDR_INIT?

Quoted 13 lines

adam

Quoted 11 lines
Quoted 10 lines

Make OMAPL138_LCDK select SOC_DA8XX instead of SOC_DA850. The
name of
CONFIG_SOC_DA8XX was left alone here since it wasn't my goal to
change
the naming convention.
WhileDA850 is probably correct, it would technically be a change
to the
compiled code and that wasn't the goal here.

author
#4 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

Quoted 35 lines · David Lechner
Quoted 34 lines · Adam Ford
Quoted 30 lines · David Lechner
Quoted 11 lines · Adam Ford

This converts the following to Kconfig:

     CONFIG_SOC_DA8XX
     CONFIG_SOC_DA850
     CONFIG_DA850_LOWLEVEL
     CONFIG_MACH_DAVINCI_DA850_EVM
     CONFIG_SYS_DA850_PLL_INIT
     CONFIG_SYS_DA850_DDR_INIT
Quoted 8 lines

---
Changes in V4:
Rebase against origin/master

Changes in V3:
Add bool for DA850_LOWLEVEL and make it select DA850_PLL_INIT
and

           DA850_DDR_INIT

It looks like da850_lowlevel.o is also compiled when CONFIG_SPL_BUILD and CONFIG_SOC_DA8XX are both defined, so this change will most likely break SPL
builds. So, probably best to just leave DA850_PLL_INIT and DA850_DDR_INIT alone for now.

Quoted 7 lines
Quoted 3 lines

Any objections to keeping the migration of DA850_PLL_INIT and DA850_DDR_INIT if I change the dependencies to set both of them when either DA850_LOWLEVEL or SPL is defined?

Wouldn't that change the EA20 board since it currently does not select DA850_PLL_INIT or DA850_DDR_INIT?

EA20 doesn't appear to be enabling SUPPORT_SPL or DA850_LOWLEVEL. Am I missing something?

I would move the selection from DA850_LOWLEVEL to SOC_DA850 like this:

config SOC_DA850
bool
select SOC_DA8XX

   select SYS_DA850_PLL_INIT if SUPPORT_SPL || DA850_LOWLEVEL
   select SYS_DA850_DDR_INIT if SUPPORT_SPL || DA850_LOWLEVEL

If neither SUPPORT_SPL nor DA850_LOWLEVEL are enabled, I would not expect this to be enabled.

What do you think?

adam

Quoted 19 lines
Quoted 18 lines

adam

Quoted 14 lines
Quoted 13 lines

Make OMAPL138_LCDK select SOC_DA8XX instead of SOC_DA850. The
name of
CONFIG_SOC_DA8XX was left alone here since it wasn't my goal
to
change
the naming convention.
WhileDA850 is probably correct, it would technically be a
change
to the
compiled code and that wasn't the goal here.

#5 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

Quoted 55 lines · Adam Ford
Quoted 35 lines · David Lechner
Quoted 34 lines · Adam Ford
Quoted 30 lines · David Lechner
Quoted 11 lines · Adam Ford

This converts the following to Kconfig:

      CONFIG_SOC_DA8XX
      CONFIG_SOC_DA850
      CONFIG_DA850_LOWLEVEL
      CONFIG_MACH_DAVINCI_DA850_EVM
      CONFIG_SYS_DA850_PLL_INIT
      CONFIG_SYS_DA850_DDR_INIT
Quoted 8 lines

---
Changes in V4:
Rebase against origin/master

Changes in V3:
Add bool for DA850_LOWLEVEL and make it select DA850_PLL_INIT
and

            DA850_DDR_INIT

It looks like da850_lowlevel.o is also compiled when CONFIG_SPL_BUILD and CONFIG_SOC_DA8XX are both defined, so this change will most likely break SPL
builds. So, probably best to just leave DA850_PLL_INIT and DA850_DDR_INIT alone for now.

Quoted 7 lines
Quoted 3 lines

Any objections to keeping the migration of DA850_PLL_INIT and DA850_DDR_INIT if I change the dependencies to set both of them when either DA850_LOWLEVEL or SPL is defined?

Wouldn't that change the EA20 board since it currently does not select DA850_PLL_INIT or DA850_DDR_INIT?

EA20 doesn't appear to be enabling SUPPORT_SPL or DA850_LOWLEVEL. Am I missing something?

I would move the selection from DA850_LOWLEVEL to SOC_DA850 like this:

config SOC_DA850

    bool
    select SOC_DA8XX
    select SYS_DA850_PLL_INIT if SUPPORT_SPL || DA850_LOWLEVEL
    select SYS_DA850_DDR_INIT if SUPPORT_SPL || DA850_LOWLEVEL
Quoted 5 lines

If neither SUPPORT_SPL nor DA850_LOWLEVEL are enabled, I would not expect this to be enabled.

What do you think?

I didn't dig that deep, so sounds good to me. However, if you are always enabling SYS_DA850_PLL_INIT and SYS_DA850_DDR_INIT when da850_low_level.c is compiled, then you might as well just remove those options altogether. They are not used outside of da850_low_level.c and it would clean up a bunch of #ifdefs.

author
#6 lore raw

PATCH v4 1/1 Convert CONFIG_SOC_DA8XX et al to Kconfig

Quoted 27 lines · David Lechner
Quoted 15 lines · Adam Ford
Quoted 12 lines · David Lechner
Quoted 10 lines · Adam Ford
Quoted 6 lines · David Lechner
Quoted 3 lines · Adam Ford
Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

This converts the following to Kconfig:

      CONFIG_SOC_DA8XX
      CONFIG_SOC_DA850
      CONFIG_DA850_LOWLEVEL
      CONFIG_MACH_DAVINCI_DA850_EVM
      CONFIG_SYS_DA850_PLL_INIT
      CONFIG_SYS_DA850_DDR_INIT
Quoted 5 lines

I didn't dig that deep, so sounds good to me. However, if you are always enabling SYS_DA850_PLL_INIT and SYS_DA850_DDR_INIT when da850_low_level.c is compiled, then you might as well just remove those options altogether. They are not used outside of da850_low_level.c and it would clean up a bunch of #ifdefs.

I don't want to make changes to .C source code yet. At this time, my goal is to limit it to Kconfig and defconfig files. I'll clean this up a bit more and run some tests. I think I'll make some notes to go back through it and remove the #ifdef's at a later date.
I want to be able to bisect to this point if something breaks. Once I'm confident everyone will be OK with this, I think what you're saying makes a lot of sense.

adam