Skip to contentSkip to conversation

dm: Convert boards to Kconfig for driver model

PATCH Superseded Simon Glass 8 participants 55 messages Feb 6, 2015 – Feb 19, 2015

Subsystems (15)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover dm: Convert boards to Kconfig for driver model

This series converts most boards to use Kconfig for driver model. It is based on the v1 patches but split out so that only one arch is done per patch. This makes it easier to review and test. Also since DM SPL support is not fully merged some adjustments have had to be made to allow this series to work independent of that (since I don't want to delay the Kconfig conversion any longer).

About 10 boards remain to be cleaned up and these are dealt with in a small follow-on series.

Changes in v2:
- Add CONFIG_SYS_MALLOC_F as well as CONFIG_SYS_MALLOC_F_LEN
- Add a patch to squash use of 'struct i2c_msg' in drivers
- Drop SPL-specific #ifdef in config_defaults.h since Kconfig will do this
- Fix 'procides' typo
- Move subsystem Kconfigs out of drivers/core
- Split out patch to add CMD_DM and CMD_DEMO to Kconfig
- Split out patch to add Kconfig for driver/demo
- Split out patch to add Kconfig options for driver model SPL support
- Split out patch to add a Kconfig file for test/
- Split out patch to expand/complete Kconfig in drivers/
- Use a dm_ prefix for remaining conflicting I2C functions

Simon Glass (19):
dm: i2c: Add a dm_ prefix to driver model bus speed functions
dm: i2c: Make API accessible even without CONFIG_DM
dm: Add Kconfig for driver/demo
dm: Expand and complete Kconfig in drivers/
dm: Add Kconfig options for driver model SPL support
dm: test: Add a Kconfig file
dm: Add CMD_DM and CMD_DEMO to Kconfig
dm: Move Raspberry Pi driver model CONFIGs to Kconfig
dm: exynos: Move driver model CONFIGs to Kconfig
dm: x86: Move driver model CONFIGs to Kconfig
dm: tegra: Move driver model CONFIGs to Kconfig
dm: at91: snapper: Move driver model CONFIGs to Kconfig
dm: omap3: Move driver model CONFIGs to Kconfig
dm: sandbox: Move driver model CONFIGs to Kconfig
dm: sunxi: Move driver model CONFIGs to Kconfig
dm: mx6: Move driver model CONFIGs to Kconfig
dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to Kconfig
dm: socfpga: Move driver model CONFIGs to Kconfig
dm: Drop unused driver model config_defaults

 Kconfig                                   | 21 +++++++++++++
 arch/arm/Kconfig                          |  2 ++
 arch/arm/cpu/arm1176/bcm2835/Kconfig      | 12 ++++++++
 arch/arm/cpu/armv7/exynos/Kconfig         | 21 +++++++++++++
 arch/arm/cpu/armv7/omap3/Kconfig          | 15 ++++++++++
 arch/arm/cpu/armv7/tegra-common/Kconfig   | 24 +++++++++++++++
 arch/arm/cpu/armv7/uniphier/Kconfig       |  6 ++++
 arch/arm/include/asm/arch-at91/at91_pio.h | 12 +++-----
 arch/sandbox/Kconfig                      | 24 +++++++++++++++
 arch/x86/Kconfig                          | 15 ++++++++++
 board/compulab/cm_t335/Kconfig            |  9 ++++++
 board/gumstix/pepper/Kconfig              |  9 ++++++
 board/isee/igep0033/Kconfig               |  9 ++++++
 board/phytec/pcm051/Kconfig               |  9 ++++++
 board/samsung/goni/Kconfig                |  9 ++++++
 board/samsung/smdk5420/Kconfig            |  6 ++++
 board/samsung/smdkc100/Kconfig            |  9 ++++++
 board/silica/pengwyn/Kconfig              |  9 ++++++
 board/ti/am335x/Kconfig                   | 16 ++++++++++
 common/Kconfig                            | 23 ++++++++++++++
 common/cmd_i2c.c                          |  4 +--
 configs/Linksprite_pcDuino3_fdt_defconfig |  4 +++
 configs/am335x_igep0033_defconfig         |  2 ++
 configs/am3517_crane_defconfig            |  3 ++
 configs/am3517_evm_defconfig              |  3 ++
 configs/cm_fx6_defconfig                  |  5 ++++
 configs/cm_t335_defconfig                 |  2 ++
 configs/cm_t3517_defconfig                |  3 ++
 configs/cm_t35_defconfig                  |  3 ++
 configs/devkit8000_defconfig              |  3 ++
 configs/dig297_defconfig                  |  3 ++
 configs/eco5pk_defconfig                  |  3 ++
 configs/gwventana_defconfig               |  2 ++
 configs/mcx_defconfig                     |  3 ++
 configs/mt_ventoux_defconfig              |  3 ++
 configs/mx6dlsabreauto_defconfig          |  2 ++
 configs/mx6qsabreauto_defconfig           |  2 ++
 configs/mx6qsabresd_defconfig             |  2 ++
 configs/mx6sxsabresd_defconfig            |  2 ++
 configs/nokia_rx51_defconfig              |  5 ++++
 configs/omap3_beagle_defconfig            |  3 ++
 configs/omap3_evm_defconfig               |  3 ++
 configs/omap3_evm_quick_mmc_defconfig     |  3 ++
 configs/omap3_evm_quick_nand_defconfig    |  3 ++
 configs/omap3_ha_defconfig                |  3 ++
 configs/omap3_logic_defconfig             |  3 ++
 configs/omap3_mvblx_defconfig             |  3 ++
 configs/omap3_pandora_defconfig           |  3 ++
 configs/omap3_sdp3430_defconfig           |  3 ++
 configs/pcm051_rev1_defconfig             |  2 ++
 configs/pcm051_rev3_defconfig             |  2 ++
 configs/pengwyn_defconfig                 |  2 ++
 configs/pepper_defconfig                  |  2 ++
 configs/rpi_defconfig                     |  2 ++
 configs/s5p_goni_defconfig                |  2 ++
 configs/sandbox_defconfig                 |  2 ++
 configs/smdkc100_defconfig                |  2 ++
 configs/snapper9260_defconfig             |  5 ++++
 configs/snapper9g20_defconfig             |  5 ++++
 configs/socfpga_socrates_defconfig        |  3 ++
 configs/stv0991_defconfig                 |  2 ++
 configs/tao3530_defconfig                 |  3 ++
 configs/tricorder_defconfig               |  3 ++
 configs/tricorder_flash_defconfig         |  3 ++
 configs/twister_defconfig                 |  3 ++
 doc/driver-model/spi-howto.txt            |  4 +--
 drivers/Kconfig                           |  4 +++
 drivers/core/Kconfig                      | 50 +++++++++++++++++++++++++++++--
 drivers/demo/Kconfig                      | 26 ++++++++++++++++
 drivers/gpio/Kconfig                      |  7 +++--
 drivers/i2c/Kconfig                       | 12 ++++++--
 drivers/i2c/adi_i2c.c                     |  6 ++--
 drivers/i2c/i2c-uclass.c                  | 11 ++-----
 drivers/i2c/kona_i2c.c                    | 16 +++++-----
 drivers/i2c/mv_i2c.c                      | 10 +++----
 drivers/misc/Kconfig                      |  9 ++++++
 drivers/mtd/Kconfig                       |  2 ++
 drivers/mtd/spi/Kconfig                   | 14 +++++++++
 drivers/serial/Kconfig                    |  6 ++--
 drivers/spi/Kconfig                       | 10 +++++--
 drivers/thermal/Kconfig                   |  7 +++++
 include/config_defaults.h                 |  6 ----
 include/configs/cm_fx6.h                  |  7 -----
 include/configs/exynos-common.h           |  7 -----
 include/configs/gw_ventana.h              |  1 -
 include/configs/mx6sabre_common.h         |  1 -
 include/configs/mx6sxsabresd.h            |  1 -
 include/configs/novena.h                  |  1 -
 include/configs/peach-pi.h                |  1 -
 include/configs/peach-pit.h               |  1 -
 include/configs/rpi.h                     |  7 -----
 include/configs/s5p_goni.h                |  5 ----
 include/configs/sandbox.h                 | 13 --------
 include/configs/smdkc100.h                |  7 -----
 include/configs/snapper9260.h             |  5 ----
 include/configs/socfpga_common.h          |  7 -----
 include/configs/stv0991.h                 |  1 -
 include/configs/sunxi-common.h            |  4 ---
 include/configs/tegra-common.h            | 11 -------
 include/configs/ti_am335x_common.h        |  7 -----
 include/configs/ti_omap3_common.h         |  5 ----
 include/configs/uniphier.h                |  4 ---
 include/configs/x86-common.h              |  6 ----
 include/i2c.h                             | 13 ++++----
 test/Kconfig                              |  1 +
 test/dm/Kconfig                           |  8 +++++
 test/dm/i2c.c                             |  6 ++--
 107 files changed, 554 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/Kconfig
 create mode 100644 drivers/demo/Kconfig
 create mode 100644 drivers/mtd/spi/Kconfig
 create mode 100644 drivers/thermal/Kconfig
 create mode 100644 test/Kconfig
 create mode 100644 test/dm/Kconfig
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#1 lore raw

PATCH v2 1/19 dm: i2c: Add a dm_ prefix to driver model bus speed functions

As with i2c_read() and i2c_write(), add a dm_ prefix to the driver model versions of these functions to avoid conflicts.

---

Changes in v2:
- Use a dm_ prefix for remaining conflicting I2C functions

 common/cmd_i2c.c         |  4 ++--
 drivers/i2c/i2c-uclass.c | 11 +++--------
 include/i2c.h            |  8 ++++----
 test/dm/i2c.c            |  6 +++---
 4 files changed, 12 insertions(+), 17 deletions(-)
common/cmd_i2c.c +2 -2
index 7c3ad00..fe8f77a 100644
@@ -1730,7 +1730,7 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
 #endif
 	if (argc == 1) {
 #ifdef CONFIG_DM_I2C
-		speed = i2c_get_bus_speed(bus);
+		speed = dm_i2c_get_bus_speed(bus);
 #else
 		speed = i2c_get_bus_speed();
 #endif
@@ -1740,7 +1740,7 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
 		speed = simple_strtoul(argv[1], NULL, 10);
 		printf("Setting bus speed to %d Hz\n", speed);
 #ifdef CONFIG_DM_I2C
-		ret = i2c_set_bus_speed(bus, speed);
+		ret = dm_i2c_set_bus_speed(bus, speed);
 #else
 		ret = i2c_set_bus_speed(speed);
 #endif
drivers/i2c/i2c-uclass.c +3 -8
index eafa457..a6991bf 100644
@@ -325,7 +325,7 @@ int dm_i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
 	return ret;
 }
 
-int i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
+int dm_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
 {
 	struct dm_i2c_ops *ops = i2c_get_ops(bus);
 	struct dm_i2c_bus *i2c = bus->uclass_priv;
@@ -346,12 +346,7 @@ int i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
 	return 0;
 }
 
-/*
- * i2c_get_bus_speed:
- *
- *  Returns speed of selected I2C bus in Hz
- */
-int i2c_get_bus_speed(struct udevice *bus)
+int dm_i2c_get_bus_speed(struct udevice *bus)
 {
 	struct dm_i2c_ops *ops = i2c_get_ops(bus);
 	struct dm_i2c_bus *i2c = bus->uclass_priv;
@@ -440,7 +435,7 @@ static int i2c_post_probe(struct udevice *dev)
 	i2c->speed_hz = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
 				     "clock-frequency", 100000);
 
-	return i2c_set_bus_speed(dev, i2c->speed_hz);
+	return dm_i2c_set_bus_speed(dev, i2c->speed_hz);
 }
 
 static int i2c_post_bind(struct udevice *dev)
include/i2c.h +4 -4
index 27fe00f..1635e9a 100644
@@ -125,21 +125,21 @@ int dm_i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
 		 struct udevice **devp);
 
 /**
- * i2c_set_bus_speed() - set the speed of a bus
+ * dm_i2c_set_bus_speed() - set the speed of a bus
  *
  * @bus:	Bus to adjust
  * @speed:	Requested speed in Hz
  * @return 0 if OK, -EINVAL for invalid values
  */
-int i2c_set_bus_speed(struct udevice *bus, unsigned int speed);
+int dm_i2c_set_bus_speed(struct udevice *bus, unsigned int speed);
 
 /**
- * i2c_get_bus_speed() - get the speed of a bus
+ * dm_i2c_get_bus_speed() - get the speed of a bus
  *
  * @bus:	Bus to check
  * @return speed of selected I2C bus in Hz, -ve on error
  */
-int i2c_get_bus_speed(struct udevice *bus);
+int dm_i2c_get_bus_speed(struct udevice *bus);
 
 /**
  * i2c_set_chip_flags() - set flags for a chip
test/dm/i2c.c +3 -3
index ef88372..541b73b 100644
@@ -67,10 +67,10 @@ static int dm_test_i2c_speed(struct dm_test_state *dms)
 
 	ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
 	ut_assertok(i2c_get_chip(bus, chip, 1, &dev));
-	ut_assertok(i2c_set_bus_speed(bus, 100000));
+	ut_assertok(dm_i2c_set_bus_speed(bus, 100000));
 	ut_assertok(dm_i2c_read(dev, 0, buf, 5));
-	ut_assertok(i2c_set_bus_speed(bus, 400000));
-	ut_asserteq(400000, i2c_get_bus_speed(bus));
+	ut_assertok(dm_i2c_set_bus_speed(bus, 400000));
+	ut_asserteq(400000, dm_i2c_get_bus_speed(bus));
 	ut_assertok(dm_i2c_read(dev, 0, buf, 5));
 	ut_asserteq(-EINVAL, dm_i2c_write(dev, 0, buf, 5));
 
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#2 lore raw

PATCH v2 1/19 dm: i2c: Add a dm_ prefix to driver model bus speed functions

Hello Simon,

Am 06.02.2015 05:41, schrieb Simon Glass:

Quoted 6 lines

As with i2c_read() and i2c_write(), add a dm_ prefix to the driver model versions of these functions to avoid conflicts.

---

Quoted 8 lines

Changes in v2:
- Use a dm_ prefix for remaining conflicting I2C functions

  common/cmd_i2c.c         |  4 ++--
  drivers/i2c/i2c-uclass.c | 11 +++--------
  include/i2c.h            |  8 ++++----
  test/dm/i2c.c            |  6 +++---
  4 files changed, 12 insertions(+), 17 deletions(-)

Thanks!

bye,
Heiko

Quoted 108 lines
common/cmd_i2c.c +2 -2
index 7c3ad00..fe8f77a 100644
@@ -1730,7 +1730,7 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
  #endif
  	if (argc == 1) {
  #ifdef CONFIG_DM_I2C
-		speed = i2c_get_bus_speed(bus);
+		speed = dm_i2c_get_bus_speed(bus);
  #else
  		speed = i2c_get_bus_speed();
  #endif
@@ -1740,7 +1740,7 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
  		speed = simple_strtoul(argv[1], NULL, 10);
  		printf("Setting bus speed to %d Hz\n", speed);
  #ifdef CONFIG_DM_I2C
-		ret = i2c_set_bus_speed(bus, speed);
+		ret = dm_i2c_set_bus_speed(bus, speed);
  #else
  		ret = i2c_set_bus_speed(speed);
  #endif
drivers/i2c/i2c-uclass.c +3 -8
index eafa457..a6991bf 100644
@@ -325,7 +325,7 @@ int dm_i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
  	return ret;
  }
 
-int i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
+int dm_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
  {
  	struct dm_i2c_ops *ops = i2c_get_ops(bus);
  	struct dm_i2c_bus *i2c = bus->uclass_priv;
@@ -346,12 +346,7 @@ int i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
  	return 0;
  }
 
-/*
- * i2c_get_bus_speed:
- *
- *  Returns speed of selected I2C bus in Hz
- */
-int i2c_get_bus_speed(struct udevice *bus)
+int dm_i2c_get_bus_speed(struct udevice *bus)
  {
  	struct dm_i2c_ops *ops = i2c_get_ops(bus);
  	struct dm_i2c_bus *i2c = bus->uclass_priv;
@@ -440,7 +435,7 @@ static int i2c_post_probe(struct udevice *dev)
  	i2c->speed_hz = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
  				     "clock-frequency", 100000);
 
-	return i2c_set_bus_speed(dev, i2c->speed_hz);
+	return dm_i2c_set_bus_speed(dev, i2c->speed_hz);
  }
 
  static int i2c_post_bind(struct udevice *dev)
include/i2c.h +4 -4
index 27fe00f..1635e9a 100644
@@ -125,21 +125,21 @@ int dm_i2c_probe(struct udevice *bus, uint chip_addr, uint chip_flags,
  		 struct udevice **devp);
 
  /**
- * i2c_set_bus_speed() - set the speed of a bus
+ * dm_i2c_set_bus_speed() - set the speed of a bus
   *
   * @bus:	Bus to adjust
   * @speed:	Requested speed in Hz
   * @return 0 if OK, -EINVAL for invalid values
   */
-int i2c_set_bus_speed(struct udevice *bus, unsigned int speed);
+int dm_i2c_set_bus_speed(struct udevice *bus, unsigned int speed);
 
  /**
- * i2c_get_bus_speed() - get the speed of a bus
+ * dm_i2c_get_bus_speed() - get the speed of a bus
   *
   * @bus:	Bus to check
   * @return speed of selected I2C bus in Hz, -ve on error
   */
-int i2c_get_bus_speed(struct udevice *bus);
+int dm_i2c_get_bus_speed(struct udevice *bus);
 
  /**
   * i2c_set_chip_flags() - set flags for a chip
test/dm/i2c.c +3 -3
index ef88372..541b73b 100644
@@ -67,10 +67,10 @@ static int dm_test_i2c_speed(struct dm_test_state *dms)
 
  	ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
  	ut_assertok(i2c_get_chip(bus, chip, 1, &dev));
-	ut_assertok(i2c_set_bus_speed(bus, 100000));
+	ut_assertok(dm_i2c_set_bus_speed(bus, 100000));
  	ut_assertok(dm_i2c_read(dev, 0, buf, 5));
-	ut_assertok(i2c_set_bus_speed(bus, 400000));
-	ut_asserteq(400000, i2c_get_bus_speed(bus));
+	ut_assertok(dm_i2c_set_bus_speed(bus, 400000));
+	ut_asserteq(400000, dm_i2c_get_bus_speed(bus));
  	ut_assertok(dm_i2c_read(dev, 0, buf, 5));
  	ut_asserteq(-EINVAL, dm_i2c_write(dev, 0, buf, 5));
 
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH v2 1/19 dm: i2c: Add a dm_ prefix to driver model bus speed functions

Quoted 20 lines · Heiko Schocher

Hello Simon,

Am 06.02.2015 05:41, schrieb Simon Glass:

Quoted 7 lines

As with i2c_read() and i2c_write(), add a dm_ prefix to the driver model versions of these functions to avoid conflicts.

---

Quoted 8 lines

Changes in v2:
- Use a dm_ prefix for remaining conflicting I2C functions

  common/cmd_i2c.c         |  4 ++--
  drivers/i2c/i2c-uclass.c | 11 +++--------
  include/i2c.h            |  8 ++++----
  test/dm/i2c.c            |  6 +++---
  4 files changed, 12 insertions(+), 17 deletions(-)
Quoted 3 lines

Thanks!

Applied to u-boot-dm.

#4 lore raw

PATCH v2 2/19 dm: i2c: Make API accessible even without CONFIG_DM

In reply to Simon Glass

Make the driver model I2C API available always, even if driver model is not enabled. This allows for a 'soft' switch-over, where drivers can use the new structures in code which is compiled but not yet used. This makes migration easier in some cases.

Fix up the existing drivers which define their own 'struct i2c_msg'.

---

Changes in v2:
- Add a patch to squash use of 'struct i2c_msg' in drivers

 drivers/i2c/adi_i2c.c  |  6 +++---
 drivers/i2c/kona_i2c.c | 16 ++++++++--------
 drivers/i2c/mv_i2c.c   | 10 +++++-----
 include/i2c.h          |  5 +----
 4 files changed, 17 insertions(+), 20 deletions(-)
drivers/i2c/adi_i2c.c +3 -3
index 20495b1..c58f14a 100644
@@ -63,7 +63,7 @@ struct twi_regs {
 #endif
 
 /* All transfers are described by this data structure */
-struct i2c_msg {
+struct adi_i2c_msg {
 	u8 flags;
 #define I2C_M_COMBO		0x4
 #define I2C_M_STOP		0x2
@@ -81,7 +81,7 @@ struct i2c_msg {
  * wait_for_completion - manage the actual i2c transfer
  *	@msg: the i2c msg
  */
-static int wait_for_completion(struct twi_regs *twi, struct i2c_msg *msg)
+static int wait_for_completion(struct twi_regs *twi, struct adi_i2c_msg *msg)
 {
 	u16 int_stat, ctl;
 	ulong timebase = get_timer(0);
@@ -151,7 +151,7 @@ static int i2c_transfer(struct i2c_adapter *adap, uint8_t chip, uint addr,
 		(addr >>  8),
 		(addr >> 16),
 	};
-	struct i2c_msg msg = {
+	struct adi_i2c_msg msg = {
 		.flags = flags | (len >= 0xff ? I2C_M_STOP : 0),
 		.buf   = buffer,
 		.len   = len,
drivers/i2c/kona_i2c.c +8 -8
index 5eab338..9af496b 100644
@@ -156,7 +156,7 @@ static struct bcm_kona_i2c_dev g_i2c_devs[CONFIG_SYS_MAX_I2C_BUS] = {
 #define I2C_M_RD	0x0001	/* read data */
 #define I2C_M_NOSTART	0x4000	/* no restart between msgs */
 
-struct i2c_msg {
+struct kona_i2c_msg {
 	uint16_t addr;
 	uint16_t flags;
 	uint16_t len;
@@ -297,7 +297,7 @@ static int bcm_kona_i2c_read_fifo_single(struct bcm_kona_i2c_dev *dev,
 
 /* Read any amount of data using the RX FIFO from the i2c bus */
 static int bcm_kona_i2c_read_fifo(struct bcm_kona_i2c_dev *dev,
-				  struct i2c_msg *msg)
+				  struct kona_i2c_msg *msg)
 {
 	unsigned int bytes_to_read = MAX_RX_FIFO_SIZE;
 	unsigned int last_byte_nak = 0;
@@ -392,7 +392,7 @@ static int bcm_kona_i2c_write_fifo_single(struct bcm_kona_i2c_dev *dev,
 
 /* Write any amount of data using TX FIFO to the i2c bus */
 static int bcm_kona_i2c_write_fifo(struct bcm_kona_i2c_dev *dev,
-				   struct i2c_msg *msg)
+				   struct kona_i2c_msg *msg)
 {
 	unsigned int bytes_to_write = MAX_TX_FIFO_SIZE;
 	unsigned int bytes_written = 0;
@@ -418,7 +418,7 @@ static int bcm_kona_i2c_write_fifo(struct bcm_kona_i2c_dev *dev,
 
 /* Send i2c address */
 static int bcm_kona_i2c_do_addr(struct bcm_kona_i2c_dev *dev,
-				struct i2c_msg *msg)
+				struct kona_i2c_msg *msg)
 {
 	unsigned char addr;
 
@@ -480,9 +480,9 @@ static void bcm_kona_i2c_config_timing(struct bcm_kona_i2c_dev *dev)
 
 /* Master transfer function */
 static int bcm_kona_i2c_xfer(struct bcm_kona_i2c_dev *dev,
-			     struct i2c_msg msgs[], int num)
+			     struct kona_i2c_msg msgs[], int num)
 {
-	struct i2c_msg *pmsg;
+	struct kona_i2c_msg *pmsg;
 	int rc = 0;
 	int i;
 
@@ -635,7 +635,7 @@ static int kona_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
 			 int alen, uchar *buffer, int len)
 {
 	/* msg[0] writes the addr, msg[1] reads the data */
-	struct i2c_msg msg[2];
+	struct kona_i2c_msg msg[2];
 	unsigned char msgbuf0[64];
 	struct bcm_kona_i2c_dev *dev = kona_get_dev(adap);
 
@@ -663,7 +663,7 @@ static int kona_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
 static int kona_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
 			  int alen, uchar *buffer, int len)
 {
-	struct i2c_msg msg[1];
+	struct kona_i2c_msg msg[1];
 	unsigned char msgbuf0[64];
 	unsigned int i;
 	struct bcm_kona_i2c_dev *dev = kona_get_dev(adap);
drivers/i2c/mv_i2c.c +5 -5
index dac3463..e65cce0 100644
@@ -31,7 +31,7 @@
 #endif
 
 /* All transfers are described by this data structure */
-struct i2c_msg {
+struct mv_i2c_msg {
 	u8 condition;
 	u8 acknack;
 	u8 direction;
@@ -157,7 +157,7 @@ static int i2c_isr_set_cleared(unsigned long set_mask,
  *          -5: illegal parameters
  *          -6: bus is busy and couldn't be aquired
  */
-int i2c_transfer(struct i2c_msg *msg)
+int i2c_transfer(struct mv_i2c_msg *msg)
 {
 	int ret;
 
@@ -286,7 +286,7 @@ void i2c_init(int speed, int slaveaddr)
  */
 int i2c_probe(uchar chip)
 {
-	struct i2c_msg msg;
+	struct mv_i2c_msg msg;
 
 	i2c_reset();
 
@@ -322,7 +322,7 @@ int i2c_probe(uchar chip)
  */
 int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
-	struct i2c_msg msg;
+	struct mv_i2c_msg msg;
 	u8 addr_bytes[3]; /* lowest...highest byte of data address */
 
 	PRINTD(("i2c_read(chip=0x%02x, addr=0x%02x, alen=0x%02x, "
@@ -410,7 +410,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
  */
 int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
-	struct i2c_msg msg;
+	struct mv_i2c_msg msg;
 	u8 addr_bytes[3]; /* lowest...highest byte of data address */
 
 	PRINTD(("i2c_write(chip=0x%02x, addr=0x%02x, alen=0x%02x, "
include/i2c.h +1 -4
index 1635e9a..31b0389 100644
@@ -25,14 +25,13 @@
  * enough as to be incompatible for compilation purposes.
  */
 
-#ifdef CONFIG_DM_I2C
-
 enum dm_i2c_chip_flags {
 	DM_I2C_CHIP_10BIT	= 1 << 0, /* Use 10-bit addressing */
 	DM_I2C_CHIP_RD_ADDRESS	= 1 << 1, /* Send address for each read byte */
 	DM_I2C_CHIP_WR_ADDRESS	= 1 << 2, /* Send address for each write byte */
 };
 
+struct udevice;
 /**
  * struct dm_i2c_chip - information about an i2c chip
  *
@@ -439,8 +438,6 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len,
 int i2c_chip_ofdata_to_platdata(const void *blob, int node,
 				struct dm_i2c_chip *chip);
 
-#endif
-
 #ifndef CONFIG_DM_I2C
 
 /*
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#5 lore raw

PATCH v2 2/19 dm: i2c: Make API accessible even without CONFIG_DM

Hello Simon,

Am 06.02.2015 05:41, schrieb Simon Glass:

Quoted 10 lines

Make the driver model I2C API available always, even if driver model is not enabled. This allows for a 'soft' switch-over, where drivers can use the new structures in code which is compiled but not yet used. This makes migration easier in some cases.

Fix up the existing drivers which define their own 'struct i2c_msg'.

---

Quoted 8 lines

Changes in v2:
- Add a patch to squash use of 'struct i2c_msg' in drivers

  drivers/i2c/adi_i2c.c  |  6 +++---
  drivers/i2c/kona_i2c.c | 16 ++++++++--------
  drivers/i2c/mv_i2c.c   | 10 +++++-----
  include/i2c.h          |  5 +----
  4 files changed, 17 insertions(+), 20 deletions(-)

bye,
Heiko

Quoted 181 lines
drivers/i2c/adi_i2c.c +3 -3
index 20495b1..c58f14a 100644
@@ -63,7 +63,7 @@ struct twi_regs {
  #endif
 
  /* All transfers are described by this data structure */
-struct i2c_msg {
+struct adi_i2c_msg {
  	u8 flags;
  #define I2C_M_COMBO		0x4
  #define I2C_M_STOP		0x2
@@ -81,7 +81,7 @@ struct i2c_msg {
   * wait_for_completion - manage the actual i2c transfer
   *	@msg: the i2c msg
   */
-static int wait_for_completion(struct twi_regs *twi, struct i2c_msg *msg)
+static int wait_for_completion(struct twi_regs *twi, struct adi_i2c_msg *msg)
  {
  	u16 int_stat, ctl;
  	ulong timebase = get_timer(0);
@@ -151,7 +151,7 @@ static int i2c_transfer(struct i2c_adapter *adap, uint8_t chip, uint addr,
  		(addr >>  8),
  		(addr >> 16),
  	};
-	struct i2c_msg msg = {
+	struct adi_i2c_msg msg = {
  		.flags = flags | (len >= 0xff ? I2C_M_STOP : 0),
  		.buf   = buffer,
  		.len   = len,
drivers/i2c/kona_i2c.c +8 -8
index 5eab338..9af496b 100644
@@ -156,7 +156,7 @@ static struct bcm_kona_i2c_dev g_i2c_devs[CONFIG_SYS_MAX_I2C_BUS] = {
  #define I2C_M_RD	0x0001	/* read data */
  #define I2C_M_NOSTART	0x4000	/* no restart between msgs */
 
-struct i2c_msg {
+struct kona_i2c_msg {
  	uint16_t addr;
  	uint16_t flags;
  	uint16_t len;
@@ -297,7 +297,7 @@ static int bcm_kona_i2c_read_fifo_single(struct bcm_kona_i2c_dev *dev,
 
  /* Read any amount of data using the RX FIFO from the i2c bus */
  static int bcm_kona_i2c_read_fifo(struct bcm_kona_i2c_dev *dev,
-				  struct i2c_msg *msg)
+				  struct kona_i2c_msg *msg)
  {
  	unsigned int bytes_to_read = MAX_RX_FIFO_SIZE;
  	unsigned int last_byte_nak = 0;
@@ -392,7 +392,7 @@ static int bcm_kona_i2c_write_fifo_single(struct bcm_kona_i2c_dev *dev,
 
  /* Write any amount of data using TX FIFO to the i2c bus */
  static int bcm_kona_i2c_write_fifo(struct bcm_kona_i2c_dev *dev,
-				   struct i2c_msg *msg)
+				   struct kona_i2c_msg *msg)
  {
  	unsigned int bytes_to_write = MAX_TX_FIFO_SIZE;
  	unsigned int bytes_written = 0;
@@ -418,7 +418,7 @@ static int bcm_kona_i2c_write_fifo(struct bcm_kona_i2c_dev *dev,
 
  /* Send i2c address */
  static int bcm_kona_i2c_do_addr(struct bcm_kona_i2c_dev *dev,
-				struct i2c_msg *msg)
+				struct kona_i2c_msg *msg)
  {
  	unsigned char addr;
 
@@ -480,9 +480,9 @@ static void bcm_kona_i2c_config_timing(struct bcm_kona_i2c_dev *dev)
 
  /* Master transfer function */
  static int bcm_kona_i2c_xfer(struct bcm_kona_i2c_dev *dev,
-			     struct i2c_msg msgs[], int num)
+			     struct kona_i2c_msg msgs[], int num)
  {
-	struct i2c_msg *pmsg;
+	struct kona_i2c_msg *pmsg;
  	int rc = 0;
  	int i;
 
@@ -635,7 +635,7 @@ static int kona_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
  			 int alen, uchar *buffer, int len)
  {
  	/* msg[0] writes the addr, msg[1] reads the data */
-	struct i2c_msg msg[2];
+	struct kona_i2c_msg msg[2];
  	unsigned char msgbuf0[64];
  	struct bcm_kona_i2c_dev *dev = kona_get_dev(adap);
 
@@ -663,7 +663,7 @@ static int kona_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr,
  static int kona_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
  			  int alen, uchar *buffer, int len)
  {
-	struct i2c_msg msg[1];
+	struct kona_i2c_msg msg[1];
  	unsigned char msgbuf0[64];
  	unsigned int i;
  	struct bcm_kona_i2c_dev *dev = kona_get_dev(adap);
drivers/i2c/mv_i2c.c +5 -5
index dac3463..e65cce0 100644
@@ -31,7 +31,7 @@
  #endif
 
  /* All transfers are described by this data structure */
-struct i2c_msg {
+struct mv_i2c_msg {
  	u8 condition;
  	u8 acknack;
  	u8 direction;
@@ -157,7 +157,7 @@ static int i2c_isr_set_cleared(unsigned long set_mask,
   *          -5: illegal parameters
   *          -6: bus is busy and couldn't be aquired
   */
-int i2c_transfer(struct i2c_msg *msg)
+int i2c_transfer(struct mv_i2c_msg *msg)
  {
  	int ret;
 
@@ -286,7 +286,7 @@ void i2c_init(int speed, int slaveaddr)
   */
  int i2c_probe(uchar chip)
  {
-	struct i2c_msg msg;
+	struct mv_i2c_msg msg;
 
  	i2c_reset();
 
@@ -322,7 +322,7 @@ int i2c_probe(uchar chip)
   */
  int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
  {
-	struct i2c_msg msg;
+	struct mv_i2c_msg msg;
  	u8 addr_bytes[3]; /* lowest...highest byte of data address */
 
  	PRINTD(("i2c_read(chip=0x%02x, addr=0x%02x, alen=0x%02x, "
@@ -410,7 +410,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
   */
  int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
  {
-	struct i2c_msg msg;
+	struct mv_i2c_msg msg;
  	u8 addr_bytes[3]; /* lowest...highest byte of data address */
 
  	PRINTD(("i2c_write(chip=0x%02x, addr=0x%02x, alen=0x%02x, "
include/i2c.h +1 -4
index 1635e9a..31b0389 100644
@@ -25,14 +25,13 @@
   * enough as to be incompatible for compilation purposes.
   */
 
-#ifdef CONFIG_DM_I2C
-
  enum dm_i2c_chip_flags {
  	DM_I2C_CHIP_10BIT	= 1 << 0, /* Use 10-bit addressing */
  	DM_I2C_CHIP_RD_ADDRESS	= 1 << 1, /* Send address for each read byte */
  	DM_I2C_CHIP_WR_ADDRESS	= 1 << 2, /* Send address for each write byte */
  };
 
+struct udevice;
  /**
   * struct dm_i2c_chip - information about an i2c chip
   *
@@ -439,8 +438,6 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len,
  int i2c_chip_ofdata_to_platdata(const void *blob, int node,
  				struct dm_i2c_chip *chip);
 
-#endif
-
  #ifndef CONFIG_DM_I2C
 
  /*
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw

PATCH v2 2/19 dm: i2c: Make API accessible even without CONFIG_DM

Quoted 17 lines · Heiko Schocher

Hello Simon,

Am 06.02.2015 05:41, schrieb Simon Glass:

Quoted 14 lines

Make the driver model I2C API available always, even if driver model is not enabled. This allows for a 'soft' switch-over, where drivers can use the new structures in code which is compiled but not yet used. This makes migration easier in some cases.

Fix up the existing drivers which define their own 'struct i2c_msg'.

---

Changes in v2:
- Add a patch to squash use of 'struct i2c_msg' in drivers

Quoted 8 lines
Quoted 5 lines
  drivers/i2c/adi_i2c.c  |  6 +++---
  drivers/i2c/kona_i2c.c | 16 ++++++++--------
  drivers/i2c/mv_i2c.c   | 10 +++++-----
  include/i2c.h          |  5 +----
  4 files changed, 17 insertions(+), 20 deletions(-)

Applied to u-boot-dm.

#7 lore raw

PATCH v2 3/19 dm: Add Kconfig for driver/demo

In reply to Simon Glass

Add a suitable Kconfig for this directory.

---

Changes in v2:
- Split out patch to add Kconfig for driver/demo

 drivers/Kconfig      |  2 ++
 drivers/demo/Kconfig | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 drivers/demo/Kconfig
drivers/Kconfig +2 -0
index 128736d..021293e 100644
@@ -2,6 +2,8 @@ menu "Device Drivers"
 
 source "drivers/core/Kconfig"
 
+source "drivers/demo/Kconfig"
+
 source "drivers/pci/Kconfig"
 
 source "drivers/pcmcia/Kconfig"
drivers/demo/Kconfig new file +26 -0
new file mode 100644
index 0000000..7a8ce18
@@ -0,0 +1,26 @@
+config DM_DEMO
+	bool "Enable demo uclass support"
+	depends on DM
+	help
+	  This uclass allows you to play around with driver model. It provides
+	  an interface to a couple of demo devices. You can access it using
+	  the 'demo' command or by calling the uclass functions from your
+	  own code.
+
+config DM_DEMO_SIMPLE
+	bool "Enable simple demo device for driver model"
+	depends on DM_DEMO
+	help
+	  This device allows you to play around with driver model. It prints
+	  a message when the 'demo hello' command is executed which targets
+	  this device. It can be used to help understand how driver model
+	  works.
+
+config DM_DEMO_SHAPE
+	bool "Enable shape demo device for driver model"
+	depends on DM_DEMO
+	help
+	  This device allows you to play around with driver model. It prints
+	  a shape when the 'demo hello' command is executed which targets
+	  this device. It can be used to help understand how driver model
+	  works.
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#10 lore raw

PATCH v2 4/19 dm: Expand and complete Kconfig in drivers/

In reply to Simon Glass

Expand the help messages for each driver. Add missing Kconfig for I2C, SPI flash and thermal.

---

Changes in v2:
- Move subsystem Kconfigs out of drivers/core
- Split out patch to expand/complete Kconfig in drivers/

 doc/driver-model/spi-howto.txt |  4 ++--
 drivers/Kconfig                |  2 ++
 drivers/core/Kconfig           |  6 ++++--
 drivers/gpio/Kconfig           |  7 +++++--
 drivers/i2c/Kconfig            | 12 ++++++++++--
 drivers/misc/Kconfig           |  9 +++++++++
 drivers/mtd/Kconfig            |  2 ++
 drivers/mtd/spi/Kconfig        | 14 ++++++++++++++
 drivers/serial/Kconfig         |  6 ++++--
 drivers/spi/Kconfig            | 10 ++++++++--
 drivers/thermal/Kconfig        |  7 +++++++
 11 files changed, 67 insertions(+), 12 deletions(-)
 create mode 100644 drivers/mtd/spi/Kconfig
 create mode 100644 drivers/thermal/Kconfig
doc/driver-model/spi-howto.txt +2 -2
index 5bc29ad..ee4abf4 100644
@@ -40,8 +40,8 @@ with only minor changes:
 
 Add these to your board config:
 
-#define CONFIG_DM_SPI
-#define CONFIG_DM_SPI_FLASH
+CONFIG_DM_SPI
+CONFIG_DM_SPI_FLASH
 
 
 2. Add the skeleton
drivers/Kconfig +2 -0
index 021293e..dcce532 100644
@@ -50,4 +50,6 @@ source "drivers/dma/Kconfig"
 
 source "drivers/crypto/Kconfig"
 
+source "drivers/thermal/Kconfig"
+
 endmenu
drivers/core/Kconfig +4 -2
index d2799dc..dc32385 100644
@@ -2,5 +2,7 @@ config DM
 	bool "Enable Driver Model"
 	depends on !SPL_BUILD
 	help
-	  This config option enables Driver Model.
-	  To use legacy drivers, say N.
+	  This config option enables Driver Model. This brings in the core
+	  support, including scanning of platform data on start-up. If
+	  CONFIG_OF_CONTROL is enabled, the device tree will be scanned also
+	  when available.
drivers/gpio/Kconfig +5 -2
index d21302f..b609e73 100644
@@ -2,5 +2,8 @@ config DM_GPIO
 	bool "Enable Driver Model for GPIO drivers"
 	depends on DM
 	help
-	  If you want to use driver model for GPIO drivers, say Y.
-	  To use legacy GPIO drivers, say N.
+	  Enable driver model for GPIO access. The standard GPIO
+	  interface (gpio_get_value(), etc.) is then implemented by
+	  the GPIO uclass. Drivers provide methods to query the
+	  particular GPIOs that they provide. The uclass interface
+	  is defined in include/asm-generic/gpio.h.
drivers/i2c/Kconfig +10 -2
index 202ea5d..2cc776c 100644
@@ -2,8 +2,16 @@ config DM_I2C
 	bool "Enable Driver Model for I2C drivers"
 	depends on DM
 	help
-	  If you want to use driver model for I2C drivers, say Y.
-	  To use legacy I2C drivers, say N.
+	  Enable driver model for I2C. This SPI flash interface
+	  (spi_flash_probe(), spi_flash_write(), etc.) is then
+	  implemented by the SPI flash uclass. There is one standard
+	  SPI flash driver which knows how to probe most chips
+	  supported by U-Boot. The uclass interface is defined in
+	  include/spi_flash.h, but is currently fully compatible
+	  with the old interface to avoid confusion and duplication
+	  during the transition parent. SPI and SPI flash must be
+	  enabled together (it is not possible to use driver model
+	  for one and not the other).
 
 config SYS_I2C_UNIPHIER
 	bool "UniPhier I2C driver"
drivers/misc/Kconfig +9 -0
index e69de29..813d1c2 100644
@@ -0,0 +1,9 @@
+config DM_CROS_EC
+	bool "Enable Driver Model for Chrome OS EC"
+	depends on DM
+	help
+	  Enable driver model for the Chrome OS EC interface. This
+	  allows the cros_ec SPI driver to operate with CONFIG_DM_SPI
+	  but otherwise makes few changes. Since cros_ec also supports
+	  I2C and LPC (which don't support driver model yet), a full
+	  conversion is not yet possible.
drivers/mtd/Kconfig +2 -0
index 415ab4e..59278d1 100644
@@ -1 +1,3 @@
 source "drivers/mtd/nand/Kconfig"
+
+source "drivers/mtd/spi/Kconfig"
drivers/mtd/spi/Kconfig new file +14 -0
new file mode 100644
index 0000000..2dc46b4
@@ -0,0 +1,14 @@
+config DM_SPI_FLASH
+	bool "Enable Driver Model for SPI flash"
+	depends on DM && SPI
+	help
+	  Enable driver model for SPI flash. This SPI flash interface
+	  (spi_flash_probe(), spi_flash_write(), etc.) is then
+	  implemented by the SPI flash uclass. There is one standard
+	  SPI flash driver which knows how to probe most chips
+	  supported by U-Boot. The uclass interface is defined in
+	  include/spi_flash.h, but is currently fully compatible
+	  with the old interface to avoid confusion and duplication
+	  during the transition parent. SPI and SPI flash must be
+	  enabled together (it is not possible to use driver model
+	  for one and not the other).
drivers/serial/Kconfig +4 -2
index a0b6e02..c94353b 100644
@@ -2,8 +2,10 @@ config DM_SERIAL
 	bool "Enable Driver Model for serial drivers"
 	depends on DM
 	help
-	  If you want to use driver model for serial drivers, say Y.
-	  To use legacy serial drivers, say N.
+	  Enable driver model for serial. This replaces
+	  drivers/serial/serial.c with the serial uclass, which
+	  implements serial_putc() etc. The uclass interface is
+	  defined in include/serial.h.
 
 config UNIPHIER_SERIAL
 	bool "UniPhier on-chip UART support"
drivers/spi/Kconfig +8 -2
index e1678e6..7ae2727 100644
@@ -2,5 +2,11 @@ config DM_SPI
 	bool "Enable Driver Model for SPI drivers"
 	depends on DM
 	help
-	  If you want to use driver model for SPI drivers, say Y.
-	  To use legacy SPI drivers, say N.
+	  Enable driver model for SPI. The SPI slave interface
+	  (spi_setup_slave(), spi_xfer(), etc.) is then implemented by
+	  the SPI uclass. Drivers provide methods to access the SPI
+	  buses that they control. The uclass interface is defined in
+	  include/spi.h. The existing spi_slave structure is attached
+	  as 'parent data' to every slave on each bus. Slaves
+	  typically use driver-private data instead of extending the
+	  spi_slave structure.
drivers/thermal/Kconfig new file +7 -0
new file mode 100644
index 0000000..3c6b36d
@@ -0,0 +1,7 @@
+config DM_THERMAL
+	bool "Driver support for thermal devices"
+	help
+	  Enable support for temporary-sensing devices. Some SoCs have on-chip
+	  temperature sensors to permit warnings, speed throttling or even
+	  automatic power-off when the temperature gets too high or low. Other
+	  devices may be discrete but connected on a suitable bus.
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#11 lore raw

PATCH v2 4/19 dm: Expand and complete Kconfig in drivers/

Hi Simon,

Quoted 9 lines · On Thu, 5 Feb 2015 21:41:35 -0700 Simon Glass <[email protected]> wrote:

Expand the help messages for each driver. Add missing Kconfig for I2C, SPI flash and thermal.

---

Changes in v2:
- Move subsystem Kconfigs out of drivers/core
- Split out patch to expand/complete Kconfig in drivers/

We can remove the duplicated description from the top-level README.

Please update this patch or send a follow-up patch later. Either will do.

Assuming you can do that,

#12 lore raw

PATCH v2 4/19 dm: Expand and complete Kconfig in drivers/

Quoted 18 lines · Masahiro Yamada

Hi Simon,

Quoted 9 lines · On Thu, 5 Feb 2015 21:41:35 -0700 Simon Glass <[email protected]> wrote:

Expand the help messages for each driver. Add missing Kconfig for I2C, SPI flash and thermal.

---

Changes in v2:
- Move subsystem Kconfigs out of drivers/core
- Split out patch to expand/complete Kconfig in drivers/

Quoted 9 lines

We can remove the duplicated description from the top-level README.

Please update this patch or send a follow-up patch later. Either will do.

Assuming you can do that,

Good point. I'll send a new patch.

Applied to u-boot-dm.

#13 lore raw

PATCH v2 5/19 dm: Add Kconfig options for driver model SPL support

In reply to Simon Glass

The SPL support cannot be enabled yet, but we can add the Kconfig options in preparation for this.

---

Changes in v2:
- Drop SPL-specific #ifdef in config_defaults.h since Kconfig will do this
- Split out patch to add Kconfig options for driver model SPL support

 drivers/core/Kconfig      | 44 ++++++++++++++++++++++++++++++++++++++++++++
 include/config_defaults.h |  6 ++++++
 2 files changed, 50 insertions(+)
drivers/core/Kconfig +44 -0
index dc32385..f0d6110 100644
@@ -6,3 +6,47 @@ config DM
 	  support, including scanning of platform data on start-up. If
 	  CONFIG_OF_CONTROL is enabled, the device tree will be scanned also
 	  when available.
+
+config SPL_DM
+	bool "Enable Driver Model for SPL"
+	depends on DM && SPL
+	help
+	  Enable driver model in SPL. You will need to provide a
+	  suitable malloc() implementation. If you are not using the
+	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
+	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
+	  must provide CONFIG_SYS_MALLOC_F_LEN to set the size.
+	  In most cases driver model will only allocate a few uclasses
+	  and devices in SPL, so 1KB should be enable. See
+	  CONFIG_SYS_MALLOC_F_LEN for more details on how to enable it.
+
+config DM_WARN
+	bool "Enable warnings in driver model"
+	help
+	  The dm_warn() function can use up quite a bit of space for its
+	  strings. By default this is disabled for SPL builds to save space.
+	  This will cause dm_warn() to be compiled out - it will do nothing
+	  when called.
+	depends on DM
+	default y if !SPL_BUILD
+	default n if SPL_BUILD
+
+config DM_DEVICE_REMOVE
+	bool "Support device removal"
+	help
+	  We can save some code space by dropping support for removing a
+	  device. This is not normally required in SPL, so by default this
+	  option is disabled for SPL.
+	depends on DM
+	default y if !SPL_BUILD
+	default n if SPL_BUILD
+
+config DM_STDIO
+	bool "Support stdio registration"
+	help
+	  Normally serial drivers register with stdio so that they can be used
+	  as normal output devices. In SPL we don't normally use stdio, so
+	  we can omit this feature.
+	depends on DM
+	default y if !SPL_BUILD
+	default n if SPL_BUILD
include/config_defaults.h +6 -0
index 4d49315..fa99838 100644
@@ -21,9 +21,15 @@
 #define CONFIG_PARTITIONS 1
 
 #ifndef CONFIG_SPL_BUILD
+#ifndef CONFIG_DM_WARN
 #define CONFIG_DM_WARN
+#endif
+#ifndef CONFIG_DM_DEVICE_REMOVE
 #define CONFIG_DM_DEVICE_REMOVE
+#endif
+#ifndef CONFIG_DM_STDIO
 #define CONFIG_DM_STDIO
 #endif
+#endif
 
 #endif
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#14 lore raw

PATCH v2 5/19 dm: Add Kconfig options for driver model SPL support

Quoted 6 lines · Simon Glass

The SPL support cannot be enabled yet, but we can add the Kconfig options in preparation for this.

---

Quoted 7 lines

Changes in v2:
- Drop SPL-specific #ifdef in config_defaults.h since Kconfig will do this
- Split out patch to add Kconfig options for driver model SPL support

 drivers/core/Kconfig      | 44 ++++++++++++++++++++++++++++++++++++++++++++
 include/config_defaults.h |  6 ++++++
 2 files changed, 50 insertions(+)

Applied to u-boot-dm.

#15 lore raw

PATCH v2 6/19 dm: test: Add a Kconfig file

In reply to Simon Glass

Add a file to control driver model test features.

---

Changes in v2:
- Split out patch to add a Kconfig file for test/

 Kconfig         | 2 ++
 test/Kconfig    | 1 +
 test/dm/Kconfig | 8 ++++++++
 3 files changed, 11 insertions(+)
 create mode 100644 test/Kconfig
 create mode 100644 test/dm/Kconfig
Kconfig +2 -0
index fed488f..8e31410 100644
@@ -165,3 +165,5 @@ source "drivers/Kconfig"
 source "fs/Kconfig"
 
 source "lib/Kconfig"
+
+source "test/Kconfig"
test/Kconfig new file +1 -0
new file mode 100644
index 0000000..1fb1716
@@ -0,0 +1 @@
+source "test/dm/Kconfig"
test/dm/Kconfig new file +8 -0
new file mode 100644
index 0000000..a9d0298
@@ -0,0 +1,8 @@
+config DM_TEST
+	bool "Enable driver model test command"
+	depends on SANDBOX && CMD_DM
+	help
+	  This enables the 'dm test' command which runs a series of unit
+	  tests on the driver model code. Each subsystem (uclass) is tested.
+	  If all is well then all tests pass although there will be a few
+	  messages printed along the way.
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#18 lore raw

PATCH v2 7/19 dm: Add CMD_DM and CMD_DEMO to Kconfig

In reply to Simon Glass

Add Kconfig settings for these two options.

---

Changes in v2:
- Fix 'procides' typo
- Split out patch to add CMD_DM and CMD_DEMO to Kconfig

 common/Kconfig                     | 23 +++++++++++++++++++++++
 include/configs/sandbox.h          |  1 -
 include/configs/sunxi-common.h     |  1 -
 include/configs/ti_am335x_common.h |  1 -
 include/configs/uniphier.h         |  2 --
 5 files changed, 23 insertions(+), 5 deletions(-)
common/Kconfig +23 -0
index fd84fa0..2ca002d 100644
@@ -153,6 +153,29 @@ endmenu
 
 menu "Device access commands"
 
+config CMD_DM
+	bool "dm - Access to driver model information"
+	depends on DM
+	default y
+	help
+	  Provides access to driver model data structures and information,
+	  such as a list of devices, list of uclasses and the state of each
+	  device (e.g. activated). This is not required for operation, but
+	  can be useful to see the state of driver model for debugging or
+	  interest.
+
+config CMD_DEMO
+	bool "demo - Demonstration commands for driver model"
+	depends on DM
+	help
+	  Provides a 'demo' command which can be used to play around with
+	  driver model. To use this properly you will need to enable one or
+	  both of the demo devices (DM_DEMO_SHAPE and DM_DEMO_SIMPLE).
+	  Otherwise you will always get an empty list of devices. The demo
+	  devices are defined in the sandbox device tree, so the easiest
+	  option is to use sandbox and pass the -d point to sandbox's
+	  u-boot.dtb file.
+
 config CMD_LOADB
 	bool "loadb"
 	help
include/configs/sandbox.h +0 -1
index e9d3f32..deff4d6 100644
@@ -24,7 +24,6 @@
 #define CONFIG_BOOTSTAGE
 #define CONFIG_BOOTSTAGE_REPORT
 #define CONFIG_CMD_DEMO
-#define CONFIG_CMD_DM
 #define CONFIG_DM_DEMO
 #define CONFIG_DM_DEMO_SIMPLE
 #define CONFIG_DM_DEMO_SHAPE
include/configs/sunxi-common.h +0 -1
index 6cfd7e1..b5632d8 100644
@@ -28,7 +28,6 @@
 #define CONFIG_SYS_TEXT_BASE		0x4a000000
 
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM)
-# define CONFIG_CMD_DM
 # define CONFIG_DM_GPIO
 # define CONFIG_DM_SERIAL
 # define CONFIG_DW_SERIAL
include/configs/ti_am335x_common.h +0 -1
index 598526b..35332b5 100644
@@ -23,7 +23,6 @@
 #ifndef CONFIG_DM
 # define CONFIG_DM
 #endif
-# define CONFIG_CMD_DM
 # define CONFIG_DM_GPIO
 # define CONFIG_DM_SERIAL
 # define CONFIG_OMAP_SERIAL
include/configs/uniphier.h +0 -2
index 9ad47f6..8a7a20b 100644
@@ -190,8 +190,6 @@
 #define CONFIG_FAT_WRITE
 #define CONFIG_DOS_PARTITION
 
-#define CONFIG_CMD_DM
-
 /* memtest works on */
 #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_SDRAM_BASE + 0x01000000)
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#19 lore raw

PATCH v2 7/19 dm: Add CMD_DM and CMD_DEMO to Kconfig

Quoted 8 lines · On Thu, 5 Feb 2015 21:41:38 -0700 Simon Glass <[email protected]> wrote:

Add Kconfig settings for these two options.

---

Changes in v2:
- Fix 'procides' typo
- Split out patch to add CMD_DM and CMD_DEMO to Kconfig

I still doubt if these two commands are "Device access commands" because they just manipulate memory data
instead of getting access to real hardware devices.

But, it might not be a big deal.
Now we are more focusing on moving CONFIGs to Kconfig, so

#20 lore raw

PATCH v2 7/19 dm: Add CMD_DM and CMD_DEMO to Kconfig

Quoted 9 lines · Masahiro Yamada
Quoted 5 lines · On Thu, 5 Feb 2015 21:41:38 -0700 Simon Glass <[email protected]> wrote:

Add Kconfig settings for these two options.

---

Quoted 8 lines
Quoted 3 lines

Changes in v2:
- Fix 'procides' typo
- Split out patch to add CMD_DM and CMD_DEMO to Kconfig

I still doubt if these two commands are "Device access commands" because they just manipulate memory data
instead of getting access to real hardware devices.

Fair enough - we can rename it if you like.

Quoted 7 lines

But, it might not be a big deal.
Now we are more focusing on moving CONFIGs to Kconfig, so

Applied to u-boot-dm.

#21 lore raw

PATCH v2 8/19 dm: Move Raspberry Pi driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config header and use Kconfig instead.

---

Changes in v2: None

 arch/arm/Kconfig                     |  2 ++
 arch/arm/cpu/arm1176/bcm2835/Kconfig | 12 ++++++++++++
 include/configs/rpi.h                |  6 ------
 3 files changed, 14 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/Kconfig
arch/arm/Kconfig +2 -0
index 986b4c5..92658cd 100644
@@ -823,6 +823,8 @@ endchoice
 
 source "arch/arm/cpu/arm926ejs/davinci/Kconfig"
 
+source "arch/arm/cpu/arm1176/bcm2835/Kconfig"
+
 source "arch/arm/cpu/armv7/exynos/Kconfig"
 
 source "arch/arm/cpu/armv7/highbank/Kconfig"
arch/arm/cpu/arm1176/bcm2835/Kconfig new file +12 -0
new file mode 100644
index 0000000..94f57d7
@@ -0,0 +1,12 @@
+if TARGET_RPI
+
+config DM
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+endif
include/configs/rpi.h +0 -6
index c94f411..ea19ad8 100644
@@ -30,12 +30,6 @@
  */
 #define CONFIG_MACH_TYPE		MACH_TYPE_BCM2708
 
-/* Enable driver model */
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_SERIAL
-
 /* Memory layout */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#22 lore raw

PATCH v2 8/19 dm: Move Raspberry Pi driver model CONFIGs to Kconfig

Quoted 6 lines · Simon Glass

Remove driver model CONFIGs from the board config header and use Kconfig instead.

---

Quoted 7 lines

Changes in v2: None

 arch/arm/Kconfig                     |  2 ++
 arch/arm/cpu/arm1176/bcm2835/Kconfig | 12 ++++++++++++
 include/configs/rpi.h                |  6 ------
 3 files changed, 14 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/Kconfig

Applied to u-boot-dm.

#23 lore raw

PATCH v2 9/19 dm: exynos: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/exynos/Kconfig | 15 +++++++++++++++
 board/samsung/goni/Kconfig        |  9 +++++++++
 board/samsung/smdk5420/Kconfig    |  6 ++++++
 board/samsung/smdkc100/Kconfig    |  9 +++++++++
 include/configs/exynos-common.h   |  6 ------
 include/configs/peach-pi.h        |  1 -
 include/configs/peach-pit.h       |  1 -
 include/configs/s5p_goni.h        |  4 ----
 include/configs/smdkc100.h        |  4 ----
 9 files changed, 39 insertions(+), 16 deletions(-)
arch/arm/cpu/armv7/exynos/Kconfig +15 -0
index 7fcb5d2..17ad567 100644
@@ -65,6 +65,21 @@ endchoice
 config SYS_SOC
 	default "exynos"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
+config DM_SPI
+	default y if !SPL_BUILD
+
+config DM_SPI_FLASH
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
 source "board/samsung/smdkv310/Kconfig"
 source "board/samsung/trats/Kconfig"
 source "board/samsung/universal_c210/Kconfig"
board/samsung/goni/Kconfig +9 -0
index cbbf5a9..2c5d3fc 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "s5p_goni"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
board/samsung/smdk5420/Kconfig +6 -0
index a9d62ff..576abae 100644
@@ -22,6 +22,9 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
 	default "peach-pi"
 
+config DM_CROS_EC
+	default y
+
 endif
 
 if TARGET_PEACH_PIT
@@ -35,6 +38,9 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
 	default "peach-pit"
 
+config DM_CROS_EC
+	default y
+
 endif
 
 if TARGET_SMDK5420
board/samsung/smdkc100/Kconfig +9 -0
index d2157b4..996fe3c 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "smdkc100"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
include/configs/exynos-common.h +0 -6
index 1f3ee55..2c4f35a 100644
@@ -17,12 +17,6 @@
 #include <linux/sizes.h>
 
 #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_SERIAL
-#define CONFIG_DM_SPI
-#define CONFIG_DM_SPI_FLASH
 
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_DISPLAY_CPUINFO
include/configs/peach-pi.h +0 -1
index a1c980d..f724164 100644
@@ -44,7 +44,6 @@
 
 #define CONFIG_POWER_TPS65090_EC
 #define CONFIG_CROS_EC_SPI		/* Support CROS_EC over SPI */
-#define CONFIG_DM_CROS_EC
 
 #define CONFIG_USB_XHCI
 #define CONFIG_USB_XHCI_EXYNOS
include/configs/peach-pit.h +0 -1
index 6516a72..de12a9e 100644
@@ -44,7 +44,6 @@
 
 #define CONFIG_POWER_TPS65090_EC
 #define CONFIG_CROS_EC_SPI		/* Support CROS_EC over SPI */
-#define CONFIG_DM_CROS_EC
 
 #define CONFIG_USB_XHCI
 #define CONFIG_USB_XHCI_EXYNOS
include/configs/s5p_goni.h +0 -4
index dfa2e07..26167a4 100644
@@ -290,9 +290,5 @@
 #define CONFIG_OF_LIBFDT
 
 #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_SERIAL
 
 #endif	/* __CONFIG_H */
include/configs/smdkc100.h +0 -4
index 982d0dc..a7eb33e 100644
@@ -224,9 +224,5 @@
 #define CONFIG_OF_LIBFDT
 
 #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_SERIAL
 
 #endif	/* __CONFIG_H */
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#24 lore raw

PATCH v2 9/19 dm: exynos: Move driver model CONFIGs to Kconfig

Quoted 8 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

Quoted 10 lines
 arch/arm/cpu/armv7/exynos/Kconfig | 15 +++++++++++++++
 board/samsung/goni/Kconfig        |  9 +++++++++
 board/samsung/smdk5420/Kconfig    |  6 ++++++
 board/samsung/smdkc100/Kconfig    |  9 +++++++++
 include/configs/exynos-common.h   |  6 ------
 include/configs/peach-pi.h        |  1 -
 include/configs/peach-pit.h       |  1 -
 include/configs/s5p_goni.h        |  4 ----
 include/configs/smdkc100.h        |  4 ----
 9 files changed, 39 insertions(+), 16 deletions(-)

Applied to u-boot-dm.

#25 lore raw

PATCH v2 10/19 dm: x86: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/x86/Kconfig             | 9 +++++++++
 include/configs/x86-common.h | 5 -----
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/x86/Kconfig +9 -0
index 90e828a..1de0c91 100644
@@ -43,6 +43,15 @@ config TARGET_CROWNBAY
 
 endchoice
 
+config DM
+	default y
+
+config DM_GPIO
+	default y
+
+config DM_SERIAL
+	default y
+
 config RAMBASE
 	hex
 	default 0x100000
include/configs/x86-common.h +0 -5
index ecedfc3..a2a70d0 100644
@@ -22,11 +22,6 @@
 #define CONFIG_DISPLAY_BOARDINFO_LATE
 #define CONFIG_DISPLAY_CPUINFO
 
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_SERIAL
-
 #define CONFIG_LMB
 #define CONFIG_OF_LIBFDT
 
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#26 lore raw

PATCH v2 10/19 dm: x86: Move driver model CONFIGs to Kconfig

Quoted 11 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/x86/Kconfig             | 9 +++++++++
 include/configs/x86-common.h | 5 -----
 2 files changed, 9 insertions(+), 5 deletions(-)

Applied to u-boot-dm.

#27 lore raw

PATCH v2 11/19 dm: tegra: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/tegra-common/Kconfig | 18 ++++++++++++++++++
 include/configs/tegra-common.h          | 10 ----------
 2 files changed, 18 insertions(+), 10 deletions(-)
arch/arm/cpu/armv7/tegra-common/Kconfig +18 -0
index 1446452..93dc732 100644
@@ -20,6 +20,24 @@ endchoice
 config USE_PRIVATE_LIBGCC
 	default y if SPL_BUILD
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
+config DM_SPI
+	default y if !SPL_BUILD
+
+config DM_SPI_FLASH
+	default y if !SPL_BUILD
+
+config DM_I2C
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
 source "arch/arm/cpu/armv7/tegra20/Kconfig"
 source "arch/arm/cpu/armv7/tegra30/Kconfig"
 source "arch/arm/cpu/armv7/tegra114/Kconfig"
include/configs/tegra-common.h +0 -10
index 8f1e370..ef25980 100644
@@ -18,16 +18,6 @@
 
 #include <asm/arch/tegra.h>		/* get chip and board defs */
 
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_DM_SERIAL
-#endif
-#define CONFIG_DM_SPI
-#define CONFIG_DM_SPI_FLASH
-#define CONFIG_DM_I2C
-
 #define CONFIG_SYS_TIMER_RATE		1000000
 #define CONFIG_SYS_TIMER_COUNTER	NV_PA_TMRUS_BASE
 
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#28 lore raw

PATCH v2 11/19 dm: tegra: Move driver model CONFIGs to Kconfig

Quoted 11 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/tegra-common/Kconfig | 18 ++++++++++++++++++
 include/configs/tegra-common.h          | 10 ----------
 2 files changed, 18 insertions(+), 10 deletions(-)

Applied to u-boot-dm.

#29 lore raw

PATCH v2 12/19 dm: at91: snapper: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/include/asm/arch-at91/at91_pio.h | 12 ++++--------
 configs/snapper9260_defconfig             |  3 +++
 configs/snapper9g20_defconfig             |  3 +++
 include/configs/snapper9260.h             |  4 ----
 4 files changed, 10 insertions(+), 12 deletions(-)
arch/arm/include/asm/arch-at91/at91_pio.h +4 -8
index 50464ff..3012278 100644
@@ -114,14 +114,10 @@ typedef union at91_pio {
 		at91_port_t	pioa;
 		at91_port_t	piob;
 		at91_port_t	pioc;
-	#if (ATMEL_PIO_PORTS > 3)
-		at91_port_t	piod;
-	#endif
-	#if (ATMEL_PIO_PORTS > 4)
-		at91_port_t	pioe;
-	#endif
-	} ;
-	at91_port_t port[ATMEL_PIO_PORTS];
+		at91_port_t	piod;	/* not present in all hardware */
+		at91_port_t	pioe;/* not present in all hardware */
+	};
+	at91_port_t port[5];
 } at91_pio_t;
 
 #ifdef CONFIG_AT91_GPIO
configs/snapper9260_defconfig +3 -0
index 7055e2a..035146c 100644
@@ -1,3 +1,6 @@
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9260"
 CONFIG_ARM=y
 CONFIG_TARGET_SNAPPER9260=y
+CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SERIAL=y
configs/snapper9g20_defconfig +3 -0
index 2faae15..66c44cc 100644
@@ -1,3 +1,6 @@
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20"
 CONFIG_ARM=y
 CONFIG_TARGET_SNAPPER9260=y
+CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SERIAL=y
include/configs/snapper9260.h +0 -4
index 9fa644f..712f9b7 100644
@@ -21,10 +21,6 @@
 #define CONFIG_SYS_AT91_MAIN_CLOCK	18432000 /* External Crystal, in Hz */
 #define CONFIG_SYS_AT91_SLOW_CLOCK	32768
 #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_DM
-#define CONFIG_CMD_DM
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_SERIAL
 #define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 /* CPU */
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#30 lore raw

PATCH v2 12/19 dm: at91: snapper: Move driver model CONFIGs to Kconfig

Hi Simon,

Quoted 27 lines · On Thu, 5 Feb 2015 21:41:43 -0700 Simon Glass <[email protected]> wrote:

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/include/asm/arch-at91/at91_pio.h | 12 ++++--------
 configs/snapper9260_defconfig             |  3 +++
 configs/snapper9g20_defconfig             |  3 +++
 include/configs/snapper9260.h             |  4 ----
 4 files changed, 10 insertions(+), 12 deletions(-)
arch/arm/include/asm/arch-at91/at91_pio.h +0 -5
index 50464ff..3012278 100644
@@ -114,14 +114,10 @@ typedef union at91_pio {
 		at91_port_t	pioa;
 		at91_port_t	piob;
 		at91_port_t	pioc;
-	#if (ATMEL_PIO_PORTS > 3)
-		at91_port_t	piod;
-	#endif
-	#if (ATMEL_PIO_PORTS > 4)
-		at91_port_t	pioe;

arch/arm/include/asm/arch-at91/at91_pio.h typedef union at91_pio { · line 123

Quoted 10 lines
arch/arm/include/asm/arch-at91/at91_pio.h +4 -3
-	#endif
-	} ;
-	at91_port_t port[ATMEL_PIO_PORTS];
+		at91_port_t	piod;	/* not present in all hardware */
+		at91_port_t	pioe;/* not present in all hardware */
+	};
+	at91_port_t port[5];
 } at91_pio_t;
 
 #ifdef CONFIG_AT91_GPIO

I could not understand why this change is related to "Move driver model CONFIGs to Kconfig".

Nothing's mentioned about this change in your commit description.

Perhaps, split into two patches?

Best Regards
Masahiro Yamada

#31 lore raw

PATCH v2 12/19 dm: at91: snapper: Move driver model CONFIGs to Kconfig

Hi Masahiro,

Quoted 47 lines · Masahiro Yamada

Hi Simon,

Quoted 27 lines · On Thu, 5 Feb 2015 21:41:43 -0700 Simon Glass <[email protected]> wrote:

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/include/asm/arch-at91/at91_pio.h | 12 ++++--------
 configs/snapper9260_defconfig             |  3 +++
 configs/snapper9g20_defconfig             |  3 +++
 include/configs/snapper9260.h             |  4 ----
 4 files changed, 10 insertions(+), 12 deletions(-)
arch/arm/include/asm/arch-at91/at91_pio.h +0 -5
index 50464ff..3012278 100644
@@ -114,14 +114,10 @@ typedef union at91_pio {
              at91_port_t     pioa;
              at91_port_t     piob;
              at91_port_t     pioc;
-     #if (ATMEL_PIO_PORTS > 3)
-             at91_port_t     piod;
-     #endif
-     #if (ATMEL_PIO_PORTS > 4)
-             at91_port_t     pioe;

arch/arm/include/asm/arch-at91/at91_pio.h typedef union at91_pio { · line 123

Quoted 10 lines
arch/arm/include/asm/arch-at91/at91_pio.h +4 -3
-     #endif
-     } ;
-     at91_port_t port[ATMEL_PIO_PORTS];
+             at91_port_t     piod;   /* not present in all hardware */
+             at91_port_t     pioe;/* not present in all hardware */
+     };
+     at91_port_t port[5];
 } at91_pio_t;
 
 #ifdef CONFIG_AT91_GPIO

I could not understand why this change is related to "Move driver model CONFIGs to Kconfig".

Quoted 4 lines

Nothing's mentioned about this change in your commit description.

Perhaps, split into two patches?

With driver model, ATMEL_PIO_PORTS is defined by the platform data so we can't have a #define for it. I will see if I can split it.

Regards,
Simon

#32 lore raw

PATCH v2 13/19 dm: omap3: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/omap3/Kconfig       |  9 +++++++++
 board/compulab/cm_t335/Kconfig         |  9 +++++++++
 board/gumstix/pepper/Kconfig           |  9 +++++++++
 board/isee/igep0033/Kconfig            |  9 +++++++++
 board/phytec/pcm051/Kconfig            |  9 +++++++++
 board/silica/pengwyn/Kconfig           |  9 +++++++++
 board/ti/am335x/Kconfig                | 10 ++++++++++
 configs/am3517_crane_defconfig         |  3 +++
 configs/am3517_evm_defconfig           |  3 +++
 configs/cm_t3517_defconfig             |  3 +++
 configs/cm_t35_defconfig               |  3 +++
 configs/devkit8000_defconfig           |  3 +++
 configs/dig297_defconfig               |  3 +++
 configs/eco5pk_defconfig               |  3 +++
 configs/mcx_defconfig                  |  3 +++
 configs/mt_ventoux_defconfig           |  3 +++
 configs/nokia_rx51_defconfig           |  3 +++
 configs/omap3_beagle_defconfig         |  3 +++
 configs/omap3_evm_defconfig            |  3 +++
 configs/omap3_evm_quick_mmc_defconfig  |  3 +++
 configs/omap3_evm_quick_nand_defconfig |  3 +++
 configs/omap3_ha_defconfig             |  3 +++
 configs/omap3_logic_defconfig          |  3 +++
 configs/omap3_mvblx_defconfig          |  3 +++
 configs/omap3_pandora_defconfig        |  3 +++
 configs/omap3_sdp3430_defconfig        |  3 +++
 configs/tao3530_defconfig              |  3 +++
 configs/tricorder_defconfig            |  3 +++
 configs/tricorder_flash_defconfig      |  3 +++
 configs/twister_defconfig              |  3 +++
 include/configs/nokia_rx51.h           |  1 +
 include/configs/ti_am335x_common.h     |  5 -----
 include/configs/ti_omap3_common.h      |  4 ----
 33 files changed, 134 insertions(+), 9 deletions(-)
arch/arm/cpu/armv7/omap3/Kconfig +9 -0
index a029379..2fe3232 100644
@@ -93,6 +93,15 @@ config TARGET_TWISTER
 
 endchoice
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if DM && !SPL_BUILD
+
+config DM_SERIAL
+	default y if DM && !SPL_BUILD
+
 config SYS_SOC
 	default "omap3"
 
board/compulab/cm_t335/Kconfig +9 -0
index 683efde..aadbfbc 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "cm_t335"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
board/gumstix/pepper/Kconfig +9 -0
index 6f94612..3099a9e 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "pepper"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
board/isee/igep0033/Kconfig +9 -0
index e989e4b..2fe2ef1 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "am335x_igep0033"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
board/phytec/pcm051/Kconfig +9 -0
index 2cc0d88..65094cf 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "pcm051"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
board/silica/pengwyn/Kconfig +9 -0
index f2e1098..6ecda80 100644
@@ -12,4 +12,13 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "pengwyn"
 
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if !SPL_BUILD
+
+config DM_SERIAL
+	default y if !SPL_BUILD
+
 endif
board/ti/am335x/Kconfig +10 -0
index 1ddbb2c..d6581ac 100644
@@ -37,4 +37,14 @@ config NOR_BOOT
 	  booted via NOR.  In this case we will enable certain pinmux early
 	  as the ROM only partially sets up pinmux.  We also default to using
 	  NOR for environment.
+
+config DM
+	default y if !SPL_BUILD
+
+config DM_GPIO
+	default y if DM && !SPL_BUILD
+
+config DM_SERIAL
+	default y if DM && !SPL_BUILD
+
 endif
configs/am3517_crane_defconfig +3 -0
index cf9d8c7..33b63c7 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_AM3517_CRANE=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/am3517_evm_defconfig +3 -0
index 2336f1e..7558b89 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_AM3517_EVM=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/cm_t3517_defconfig +3 -0
index 4000d2c..6eb37c0 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=n
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_CM_T3517=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/cm_t35_defconfig +3 -0
index 2bb616f..84a6fb0 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_CM_T35=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/devkit8000_defconfig +3 -0
index 578ae74..05a8700 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_DEVKIT8000=y
+CONFIG_DM=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
configs/dig297_defconfig +3 -0
index 95bc353..0d18290 100644
@@ -1,3 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_DIG297=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/eco5pk_defconfig +3 -0
index e45bdad..e07df8b 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_ECO5PK=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/mcx_defconfig +3 -0
index c2031f8..6566d40 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_MCX=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/mt_ventoux_defconfig +3 -0
index a0678bb..a4747c6 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_MT_VENTOUX=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/nokia_rx51_defconfig +3 -0
index e03f586..20a51e1 100644
@@ -1,3 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_NOKIA_RX51=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_beagle_defconfig +3 -0
index a3e4c2c..5a2d20b 100644
@@ -3,3 +3,6 @@ CONFIG_SYS_EXTRA_OPTIONS="NAND"
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_OMAP3_BEAGLE=y
+CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SERIAL=y
configs/omap3_evm_defconfig +3 -0
index c749aa7..3bb1911 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_OMAP3_EVM=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_evm_quick_mmc_defconfig +3 -0
index e89bb82..4e1471b 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_OMAP3_EVM_QUICK_MMC=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_evm_quick_nand_defconfig +3 -0
index e70fddd..f98672f 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_OMAP3_EVM_QUICK_NAND=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_ha_defconfig +3 -0
index 50bffa9..1a8b1b4 100644
@@ -3,3 +3,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_BOARD_OMAP3_HA"
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_TAO3530=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_logic_defconfig +3 -0
index 5f2c063..790ccba 100644
@@ -1,3 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_OMAP3_LOGIC=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_mvblx_defconfig +3 -0
index fb6edc2..b75f513 100644
@@ -1,3 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_OMAP3_MVBLX=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_pandora_defconfig +3 -0
index bf28537..dd0f17c 100644
@@ -1,3 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_OMAP3_PANDORA=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/omap3_sdp3430_defconfig +3 -0
index 1172c2a..b3a8745 100644
@@ -1,3 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_OMAP3_SDP3430=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/tao3530_defconfig +3 -0
index a511389..39ed872 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_TAO3530=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/tricorder_defconfig +3 -0
index 7ea5e02..3efe829 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_TRICORDER=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/tricorder_flash_defconfig +3 -0
index f6e1c46..8f999ff 100644
@@ -3,3 +3,6 @@ CONFIG_SYS_EXTRA_OPTIONS="FLASHCARD"
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_TRICORDER=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
configs/twister_defconfig +3 -0
index 9023736..d21a551 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_OMAP34XX=y
 +S:CONFIG_TARGET_TWISTER=y
+CONFIG_DM=n
+CONFIG_DM_SERIAL=n
+CONFIG_DM_GPIO=n
include/configs/nokia_rx51.h +1 -0
index 46fc91e..6e1f501 100644
@@ -72,6 +72,7 @@
 #define CONFIG_UBI_SIZE			(512 << 10)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
 					(128 << 10))
+#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 /*
  * Hardware drivers
include/configs/ti_am335x_common.h +0 -5
index 35332b5..4ce9d49 100644
@@ -20,11 +20,6 @@
 #define CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
 
 #ifndef CONFIG_SPL_BUILD
-#ifndef CONFIG_DM
-# define CONFIG_DM
-#endif
-# define CONFIG_DM_GPIO
-# define CONFIG_DM_SERIAL
 # define CONFIG_OMAP_SERIAL
 # define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #endif
include/configs/ti_omap3_common.h +0 -4
index 3c634ee..77211de 100644
@@ -19,10 +19,6 @@
 #include <asm/arch/omap3.h>
 
 #ifndef CONFIG_SPL_BUILD
-# define CONFIG_DM
-# define CONFIG_CMD_DM
-# define CONFIG_DM_GPIO
-# define CONFIG_DM_SERIAL
 # define CONFIG_OMAP_SERIAL
 # define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #endif
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#33 lore raw

PATCH v2 13/19 dm: omap3: Move driver model CONFIGs to Kconfig

Hi Simon,

Quoted 53 lines · On Thu, 5 Feb 2015 21:41:44 -0700 Simon Glass <[email protected]> wrote:

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/omap3/Kconfig       |  9 +++++++++
 board/compulab/cm_t335/Kconfig         |  9 +++++++++
 board/gumstix/pepper/Kconfig           |  9 +++++++++
 board/isee/igep0033/Kconfig            |  9 +++++++++
 board/phytec/pcm051/Kconfig            |  9 +++++++++
 board/silica/pengwyn/Kconfig           |  9 +++++++++
 board/ti/am335x/Kconfig                | 10 ++++++++++
 configs/am3517_crane_defconfig         |  3 +++
 configs/am3517_evm_defconfig           |  3 +++
 configs/cm_t3517_defconfig             |  3 +++
 configs/cm_t35_defconfig               |  3 +++
 configs/devkit8000_defconfig           |  3 +++
 configs/dig297_defconfig               |  3 +++
 configs/eco5pk_defconfig               |  3 +++
 configs/mcx_defconfig                  |  3 +++
 configs/mt_ventoux_defconfig           |  3 +++
 configs/nokia_rx51_defconfig           |  3 +++
 configs/omap3_beagle_defconfig         |  3 +++
 configs/omap3_evm_defconfig            |  3 +++
 configs/omap3_evm_quick_mmc_defconfig  |  3 +++
 configs/omap3_evm_quick_nand_defconfig |  3 +++
 configs/omap3_ha_defconfig             |  3 +++
 configs/omap3_logic_defconfig          |  3 +++
 configs/omap3_mvblx_defconfig          |  3 +++
 configs/omap3_pandora_defconfig        |  3 +++
 configs/omap3_sdp3430_defconfig        |  3 +++
 configs/tao3530_defconfig              |  3 +++
 configs/tricorder_defconfig            |  3 +++
 configs/tricorder_flash_defconfig      |  3 +++
 configs/twister_defconfig              |  3 +++
 include/configs/nokia_rx51.h           |  1 +
 include/configs/ti_am335x_common.h     |  5 -----
 include/configs/ti_omap3_common.h      |  4 ----
 33 files changed, 134 insertions(+), 9 deletions(-)
arch/arm/cpu/armv7/omap3/Kconfig +2 -0
index a029379..2fe3232 100644
@@ -93,6 +93,15 @@ config TARGET_TWISTER
 
 endchoice
 
+config DM
+	default y if !SPL_BUILD

arch/arm/cpu/armv7/omap3/Kconfig config TARGET_TWISTER · line 107

Quoted 10 lines
arch/arm/cpu/armv7/omap3/Kconfig +7 -0
+
+config DM_GPIO
+	default y if DM && !SPL_BUILD
+
+config DM_SERIAL
+	default y if DM && !SPL_BUILD
+
 config SYS_SOC
 	default "omap3"
 

I realized a problem when I looked at this patch.

In order to put the default values into board-Kconfig files, we have to describe the "if ..." part correctly. (otherwise, the dependencies between CONFIGs get broken.)

We had already added the same dependencies in the common parts:

config DM
bool "Enable Driver Model"
depends on !SPL_BUILD

config DM_SERIAL
bool "Enable Driver Model for serial drivers" depends on DM

Now, we are duplicating the same dependencies in each board-Kconfig. This is not nice.

I am very sorry, I have misguided you.
(What is worse, I can not suggest a good idea to solve this problem.)

Best Regards
Masahiro Yamada

#34 lore raw

PATCH v2 13/19 dm: omap3: Move driver model CONFIGs to Kconfig

Hi Masahiro,

Quoted 89 lines · Masahiro Yamada

Hi Simon,

Quoted 53 lines · On Thu, 5 Feb 2015 21:41:44 -0700 Simon Glass <[email protected]> wrote:

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/omap3/Kconfig       |  9 +++++++++
 board/compulab/cm_t335/Kconfig         |  9 +++++++++
 board/gumstix/pepper/Kconfig           |  9 +++++++++
 board/isee/igep0033/Kconfig            |  9 +++++++++
 board/phytec/pcm051/Kconfig            |  9 +++++++++
 board/silica/pengwyn/Kconfig           |  9 +++++++++
 board/ti/am335x/Kconfig                | 10 ++++++++++
 configs/am3517_crane_defconfig         |  3 +++
 configs/am3517_evm_defconfig           |  3 +++
 configs/cm_t3517_defconfig             |  3 +++
 configs/cm_t35_defconfig               |  3 +++
 configs/devkit8000_defconfig           |  3 +++
 configs/dig297_defconfig               |  3 +++
 configs/eco5pk_defconfig               |  3 +++
 configs/mcx_defconfig                  |  3 +++
 configs/mt_ventoux_defconfig           |  3 +++
 configs/nokia_rx51_defconfig           |  3 +++
 configs/omap3_beagle_defconfig         |  3 +++
 configs/omap3_evm_defconfig            |  3 +++
 configs/omap3_evm_quick_mmc_defconfig  |  3 +++
 configs/omap3_evm_quick_nand_defconfig |  3 +++
 configs/omap3_ha_defconfig             |  3 +++
 configs/omap3_logic_defconfig          |  3 +++
 configs/omap3_mvblx_defconfig          |  3 +++
 configs/omap3_pandora_defconfig        |  3 +++
 configs/omap3_sdp3430_defconfig        |  3 +++
 configs/tao3530_defconfig              |  3 +++
 configs/tricorder_defconfig            |  3 +++
 configs/tricorder_flash_defconfig      |  3 +++
 configs/twister_defconfig              |  3 +++
 include/configs/nokia_rx51.h           |  1 +
 include/configs/ti_am335x_common.h     |  5 -----
 include/configs/ti_omap3_common.h      |  4 ----
 33 files changed, 134 insertions(+), 9 deletions(-)
arch/arm/cpu/armv7/omap3/Kconfig +2 -0
index a029379..2fe3232 100644
@@ -93,6 +93,15 @@ config TARGET_TWISTER
 
 endchoice
 
+config DM
+     default y if !SPL_BUILD

arch/arm/cpu/armv7/omap3/Kconfig config TARGET_TWISTER · line 107

Quoted 10 lines
arch/arm/cpu/armv7/omap3/Kconfig +7 -0
+
+config DM_GPIO
+     default y if DM && !SPL_BUILD
+
+config DM_SERIAL
+     default y if DM && !SPL_BUILD
+
 config SYS_SOC
      default "omap3"
 

I realized a problem when I looked at this patch.

In order to put the default values into board-Kconfig files, we have to describe the "if ..." part correctly. (otherwise, the dependencies between CONFIGs get broken.)

We had already added the same dependencies in the common parts:

config DM
bool "Enable Driver Model"
depends on !SPL_BUILD

config DM_SERIAL
bool "Enable Driver Model for serial drivers" depends on DM

Quoted 5 lines

Now, we are duplicating the same dependencies in each board-Kconfig. This is not nice.

I am very sorry, I have misguided you.
(What is worse, I can not suggest a good idea to solve this problem.)

Yes it is unfortunate. However the problem of SPL not working for DM is only waiting on the removal of gdata. In fact I have a series which adds an #ifndef CONFIG_DM to the gdata and enables SPL for Tegra. I'll send it soon.

So I think we can live with this for a while until we can remove the 'depends on !SPL_BUILD' everywhere. It does seem to work well enough...

Regards,
Simon

#35 lore raw

PATCH v2 13/19 dm: omap3: Move driver model CONFIGs to Kconfig

Quoted 103 lines · Simon Glass

Hi Masahiro,

Quoted 89 lines · Masahiro Yamada

Hi Simon,

Quoted 53 lines · On Thu, 5 Feb 2015 21:41:44 -0700 Simon Glass <[email protected]> wrote:

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/arm/cpu/armv7/omap3/Kconfig       |  9 +++++++++
 board/compulab/cm_t335/Kconfig         |  9 +++++++++
 board/gumstix/pepper/Kconfig           |  9 +++++++++
 board/isee/igep0033/Kconfig            |  9 +++++++++
 board/phytec/pcm051/Kconfig            |  9 +++++++++
 board/silica/pengwyn/Kconfig           |  9 +++++++++
 board/ti/am335x/Kconfig                | 10 ++++++++++
 configs/am3517_crane_defconfig         |  3 +++
 configs/am3517_evm_defconfig           |  3 +++
 configs/cm_t3517_defconfig             |  3 +++
 configs/cm_t35_defconfig               |  3 +++
 configs/devkit8000_defconfig           |  3 +++
 configs/dig297_defconfig               |  3 +++
 configs/eco5pk_defconfig               |  3 +++
 configs/mcx_defconfig                  |  3 +++
 configs/mt_ventoux_defconfig           |  3 +++
 configs/nokia_rx51_defconfig           |  3 +++
 configs/omap3_beagle_defconfig         |  3 +++
 configs/omap3_evm_defconfig            |  3 +++
 configs/omap3_evm_quick_mmc_defconfig  |  3 +++
 configs/omap3_evm_quick_nand_defconfig |  3 +++
 configs/omap3_ha_defconfig             |  3 +++
 configs/omap3_logic_defconfig          |  3 +++
 configs/omap3_mvblx_defconfig          |  3 +++
 configs/omap3_pandora_defconfig        |  3 +++
 configs/omap3_sdp3430_defconfig        |  3 +++
 configs/tao3530_defconfig              |  3 +++
 configs/tricorder_defconfig            |  3 +++
 configs/tricorder_flash_defconfig      |  3 +++
 configs/twister_defconfig              |  3 +++
 include/configs/nokia_rx51.h           |  1 +
 include/configs/ti_am335x_common.h     |  5 -----
 include/configs/ti_omap3_common.h      |  4 ----
 33 files changed, 134 insertions(+), 9 deletions(-)
arch/arm/cpu/armv7/omap3/Kconfig +2 -0
index a029379..2fe3232 100644
@@ -93,6 +93,15 @@ config TARGET_TWISTER
 
 endchoice
 
+config DM
+     default y if !SPL_BUILD

arch/arm/cpu/armv7/omap3/Kconfig config TARGET_TWISTER · line 107

Quoted 10 lines
arch/arm/cpu/armv7/omap3/Kconfig +7 -0
+
+config DM_GPIO
+     default y if DM && !SPL_BUILD
+
+config DM_SERIAL
+     default y if DM && !SPL_BUILD
+
 config SYS_SOC
      default "omap3"
 

I realized a problem when I looked at this patch.

In order to put the default values into board-Kconfig files, we have to describe the "if ..." part correctly. (otherwise, the dependencies between CONFIGs get broken.)

We had already added the same dependencies in the common parts:

config DM
bool "Enable Driver Model"
depends on !SPL_BUILD

config DM_SERIAL
bool "Enable Driver Model for serial drivers" depends on DM

Quoted 5 lines

Now, we are duplicating the same dependencies in each board-Kconfig. This is not nice.

I am very sorry, I have misguided you.
(What is worse, I can not suggest a good idea to solve this problem.)

Yes it is unfortunate. However the problem of SPL not working for DM is only waiting on the removal of gdata. In fact I have a series which adds an #ifndef CONFIG_DM to the gdata and enables SPL for Tegra. I'll send it soon.

Quoted 6 lines

So I think we can live with this for a while until we can remove the 'depends on !SPL_BUILD' everywhere. It does seem to work well enough...

Regards,
Simon

Applied to u-boot-dm.

#36 lore raw

PATCH v2 14/19 dm: sandbox: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/sandbox/Kconfig      | 24 ++++++++++++++++++++++++
 include/configs/sandbox.h | 11 -----------
 2 files changed, 24 insertions(+), 11 deletions(-)
arch/sandbox/Kconfig +24 -0
index 3057325..2098b9c 100644
@@ -10,4 +10,28 @@ config SYS_BOARD
 config SYS_CONFIG_NAME
 	default "sandbox"
 
+config DM
+	default y
+
+config DM_GPIO
+	default y
+
+config DM_SERIAL
+	default y
+
+config DM_CROS_EC
+	default y
+
+config DM_SPI
+	default y
+
+config DM_SPI_FLASH
+	default y
+
+config DM_I2C
+	default y
+
+config DM_TEST
+	default y
+
 endmenu
include/configs/sandbox.h +0 -11
index deff4d6..bff0170 100644
@@ -23,14 +23,6 @@
 
 #define CONFIG_BOOTSTAGE
 #define CONFIG_BOOTSTAGE_REPORT
-#define CONFIG_CMD_DEMO
-#define CONFIG_DM_DEMO
-#define CONFIG_DM_DEMO_SIMPLE
-#define CONFIG_DM_DEMO_SHAPE
-#define CONFIG_DM_GPIO
-#define CONFIG_DM_TEST
-#define CONFIG_DM_SERIAL
-#define CONFIG_DM_CROS_EC
 
 #define CONFIG_SYS_STDIO_DEREGISTER
 
@@ -95,8 +87,6 @@
 #define CONFIG_CMD_SF_TEST
 #define CONFIG_CMD_SPI
 #define CONFIG_SPI_FLASH
-#define CONFIG_DM_SPI
-#define CONFIG_DM_SPI_FLASH
 #define CONFIG_SPI_FLASH_ATMEL
 #define CONFIG_SPI_FLASH_EON
 #define CONFIG_SPI_FLASH_GIGADEVICE
@@ -107,7 +97,6 @@
 #define CONFIG_SPI_FLASH_STMICRO
 #define CONFIG_SPI_FLASH_WINBOND
 
-#define CONFIG_DM_I2C
 #define CONFIG_CMD_I2C
 #define CONFIG_SYS_I2C_SANDBOX
 #define CONFIG_I2C_EDID
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#37 lore raw

PATCH v2 14/19 dm: sandbox: Move driver model CONFIGs to Kconfig

Quoted 11 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 arch/sandbox/Kconfig      | 24 ++++++++++++++++++++++++
 include/configs/sandbox.h | 11 -----------
 2 files changed, 24 insertions(+), 11 deletions(-)

Applied to u-boot-dm.

#38 lore raw

PATCH v2 15/19 dm: sunxi: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 configs/Linksprite_pcDuino3_fdt_defconfig | 2 ++
 include/configs/sunxi-common.h            | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
configs/Linksprite_pcDuino3_fdt_defconfig +2 -0
index 3b6dfa6..cfed375 100644
@@ -2,6 +2,8 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPH(2),USB_EHCI"
 CONFIG_FDTFILE="sun7i-a20-pcduino3.dtb"
 CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3"
 CONFIG_OF_CONTROL=y
 CONFIG_OF_SEPARATE=y
include/configs/sunxi-common.h +0 -2
index b5632d8..6930bf6 100644
@@ -28,8 +28,6 @@
 #define CONFIG_SYS_TEXT_BASE		0x4a000000
 
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM)
-# define CONFIG_DM_GPIO
-# define CONFIG_DM_SERIAL
 # define CONFIG_DW_SERIAL
 # define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #endif
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#40 lore raw

PATCH v2 15/19 dm: sunxi: Move driver model CONFIGs to Kconfig

Quoted 10 lines · Ian Campbell
Quoted 4 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

I assume you'll take this via the dm tree along with the rest of the series.

Thanks - yes, but will give it a few days to wait for more comments.

Regards,
Simon

#41 lore raw

PATCH v2 15/19 dm: sunxi: Move driver model CONFIGs to Kconfig

Quoted 9 lines · Simon Glass
Quoted 8 lines · Ian Campbell
Quoted 4 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

Quoted 7 lines
Quoted 2 lines

I assume you'll take this via the dm tree along with the rest of the series.

Thanks - yes, but will give it a few days to wait for more comments.

Regards,
Simon

Applied to u-boot-dm.

#42 lore raw

PATCH v2 16/19 dm: mx6: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 configs/cm_fx6_defconfig | 3 +++
 include/configs/cm_fx6.h | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)
configs/cm_fx6_defconfig +3 -0
index 3c0d64f..d2ebf69 100644
@@ -2,3 +2,6 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL,SPL"
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_CM_FX6=y
+CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SERIAL=y
include/configs/cm_fx6.h +0 -4
index f7277eb..0a4d93f 100644
@@ -21,13 +21,9 @@
 #define CONFIG_MACH_TYPE		4273
 
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_DM
-#define CONFIG_CMD_DM
 
-#define CONFIG_DM_GPIO
 #define CONFIG_CMD_GPIO
 
-#define CONFIG_DM_SERIAL
 #define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 #endif
 
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#43 lore raw

PATCH v2 16/19 dm: mx6: Move driver model CONFIGs to Kconfig

Quoted 11 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 configs/cm_fx6_defconfig | 3 +++
 include/configs/cm_fx6.h | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

Applied to u-boot-dm.

#44 lore raw

PATCH v2 17/19 dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to Kconfig

In reply to Simon Glass

Move this option to Kconfig and update all boards.

---

Changes in v2:
- Add CONFIG_SYS_MALLOC_F as well as CONFIG_SYS_MALLOC_F_LEN

 Kconfig                                   | 19 +++++++++++++++++++
 arch/arm/cpu/armv7/exynos/Kconfig         |  6 ++++++
 arch/arm/cpu/armv7/omap3/Kconfig          |  6 ++++++
 arch/arm/cpu/armv7/tegra-common/Kconfig   |  6 ++++++
 arch/arm/cpu/armv7/uniphier/Kconfig       |  6 ++++++
 arch/x86/Kconfig                          |  6 ++++++
 board/ti/am335x/Kconfig                   |  6 ++++++
 configs/Linksprite_pcDuino3_fdt_defconfig |  2 ++
 configs/am335x_igep0033_defconfig         |  2 ++
 configs/cm_fx6_defconfig                  |  2 ++
 configs/cm_t335_defconfig                 |  2 ++
 configs/gwventana_defconfig               |  2 ++
 configs/mx6dlsabreauto_defconfig          |  2 ++
 configs/mx6qsabreauto_defconfig           |  2 ++
 configs/mx6qsabresd_defconfig             |  2 ++
 configs/mx6sxsabresd_defconfig            |  2 ++
 configs/nokia_rx51_defconfig              |  2 ++
 configs/pcm051_rev1_defconfig             |  2 ++
 configs/pcm051_rev3_defconfig             |  2 ++
 configs/pengwyn_defconfig                 |  2 ++
 configs/pepper_defconfig                  |  2 ++
 configs/rpi_defconfig                     |  2 ++
 configs/s5p_goni_defconfig                |  2 ++
 configs/sandbox_defconfig                 |  2 ++
 configs/smdkc100_defconfig                |  2 ++
 configs/snapper9260_defconfig             |  2 ++
 configs/snapper9g20_defconfig             |  2 ++
 configs/stv0991_defconfig                 |  2 ++
 include/configs/cm_fx6.h                  |  3 ---
 include/configs/exynos-common.h           |  1 -
 include/configs/gw_ventana.h              |  1 -
 include/configs/mx6sabre_common.h         |  1 -
 include/configs/mx6sxsabresd.h            |  1 -
 include/configs/nokia_rx51.h              |  1 -
 include/configs/novena.h                  |  1 -
 include/configs/rpi.h                     |  1 -
 include/configs/s5p_goni.h                |  1 -
 include/configs/sandbox.h                 |  1 -
 include/configs/smdkc100.h                |  3 ---
 include/configs/snapper9260.h             |  1 -
 include/configs/stv0991.h                 |  1 -
 include/configs/sunxi-common.h            |  1 -
 include/configs/tegra-common.h            |  1 -
 include/configs/ti_am335x_common.h        |  1 -
 include/configs/ti_omap3_common.h         |  1 -
 include/configs/uniphier.h                |  2 --
 include/configs/x86-common.h              |  1 -
 47 files changed, 97 insertions(+), 24 deletions(-)
Kconfig +19 -0
index 8e31410..1951c19 100644
@@ -56,6 +56,25 @@ config CC_OPTIMIZE_FOR_SIZE
 
 	  This option is enabled by default for U-Boot.
 
+config SYS_MALLOC_F
+	bool "Enable malloc() pool before relocation"
+	default 0x400
+	help
+	  Before relocation memory is very limited on many platforms. Still,
+	  we can provide a small malloc() pool if needed. Driver model in
+	  particular needs this to operate, so that it can allocate the
+	  initial serial device and any others that are needed.
+
+config SYS_MALLOC_F_LEN
+	hex "Size of malloc() pool before relocation"
+	depends on SYS_MALLOC_F
+	default 0x400
+	help
+	  Before relocation memory is very limited on many platforms. Still,
+	  we can provide a small malloc() pool if needed. Driver model in
+	  particular needs this to operate, so that it can allocate the
+	  initial serial device and any others that are needed.
+
 menuconfig EXPERT
         bool "Configure standard U-Boot features (expert users)"
         help
arch/arm/cpu/armv7/exynos/Kconfig +6 -0
index 17ad567..2064efa 100644
@@ -80,6 +80,12 @@ config DM_SPI_FLASH
 config DM_GPIO
 	default y if !SPL_BUILD
 
+config SYS_MALLOC_F
+	default y if !SPL_BUILD
+
+config SYS_MALLOC_F_LEN
+	default 0x400 if !SPL_BUILD
+
 source "board/samsung/smdkv310/Kconfig"
 source "board/samsung/trats/Kconfig"
 source "board/samsung/universal_c210/Kconfig"
arch/arm/cpu/armv7/omap3/Kconfig +6 -0
index 2fe3232..4644098 100644
@@ -102,6 +102,12 @@ config DM_GPIO
 config DM_SERIAL
 	default y if DM && !SPL_BUILD
 
+config SYS_MALLOC_F
+	default y if DM && !SPL_BUILD
+
+config SYS_MALLOC_F_LEN
+	default 0x400 if DM && !SPL_BUILD
+
 config SYS_SOC
 	default "omap3"
 
arch/arm/cpu/armv7/tegra-common/Kconfig +6 -0
index 93dc732..ee32469 100644
@@ -17,6 +17,12 @@ config TEGRA124
 
 endchoice
 
+config SYS_MALLOC_F
+	default y
+
+config SYS_MALLOC_F_LEN
+	default 0x1800
+
 config USE_PRIVATE_LIBGCC
 	default y if SPL_BUILD
 
arch/arm/cpu/armv7/uniphier/Kconfig +6 -0
index 0556e4b..4a38cbd 100644
@@ -48,6 +48,12 @@ config DCC_MICRO_SUPPORT_CARD
 
 endchoice
 
+config SYS_MALLOC_F
+	default y
+
+config SYS_MALLOC_F_LEN
+	default 0x2000
+
 config CMD_PINMON
 	bool "Enable boot mode pins monitor command"
 	depends on !SPL_BUILD
arch/x86/Kconfig +6 -0
index 1de0c91..b6c5c5b 100644
@@ -52,6 +52,12 @@ config DM_GPIO
 config DM_SERIAL
 	default y
 
+config SYS_MALLOC_F
+	default y
+
+config SYS_MALLOC_F_LEN
+	default 0x800
+
 config RAMBASE
 	hex
 	default 0x100000
board/ti/am335x/Kconfig +6 -0
index d6581ac..a20e0c1 100644
@@ -47,4 +47,10 @@ config DM_GPIO
 config DM_SERIAL
 	default y if DM && !SPL_BUILD
 
+config SYS_MALLOC_F
+	default y if DM && !SPL_BUILD
+
+config SYS_MALLOC_F_LEN
+	default 0x400 if DM && !SPL_BUILD
+
 endif
configs/Linksprite_pcDuino3_fdt_defconfig +2 -0
index cfed375..1e749cd 100644
@@ -13,3 +13,5 @@ CONFIG_OF_SEPARATE=y
 +S:CONFIG_DRAM_CLK=480
 +S:CONFIG_DRAM_ZQ=122
 +S:CONFIG_DRAM_EMR1=4
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/am335x_igep0033_defconfig +2 -0
index 23f0a32..f3544b5 100644
@@ -1,3 +1,5 @@
 CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_AM335X_IGEP0033=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/cm_fx6_defconfig +2 -0
index d2ebf69..631698c 100644
@@ -5,3 +5,5 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL,SPL"
 CONFIG_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/cm_t335_defconfig +2 -0
index 5ff4f9c..5c1d3cf 100644
@@ -1,3 +1,5 @@
 CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_CM_T335=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/gwventana_defconfig +2 -0
index 4cddbdd..5b1a4c4 100644
@@ -2,3 +2,5 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL"
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_GW_VENTANA=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/mx6dlsabreauto_defconfig +2 -0
index b649935..ccdfe31 100644
@@ -1,3 +1,5 @@
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qsabreauto/mx6dl.cfg,MX6DL"
 CONFIG_ARM=y
 CONFIG_TARGET_MX6QSABREAUTO=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/mx6qsabreauto_defconfig +2 -0
index 7d86700..fe3d797 100644
@@ -1,3 +1,5 @@
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qsabreauto/imximage.cfg,MX6Q"
 CONFIG_ARM=y
 CONFIG_TARGET_MX6QSABREAUTO=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/mx6qsabresd_defconfig +2 -0
index 67c1b77..09b0190 100644
@@ -1,3 +1,5 @@
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6sabresd/mx6q_4x_mt41j128.cfg,MX6Q"
 CONFIG_ARM=y
 CONFIG_TARGET_MX6SABRESD=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/mx6sxsabresd_defconfig +2 -0
index f23d48f..72e0f10 100644
@@ -1,3 +1,5 @@
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6sxsabresd/imximage.cfg,MX6SX"
 CONFIG_ARM=y
 CONFIG_TARGET_MX6SXSABRESD=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/nokia_rx51_defconfig +2 -0
index 20a51e1..1bb7664 100644
@@ -4,3 +4,5 @@ CONFIG_TARGET_NOKIA_RX51=y
 CONFIG_DM=n
 CONFIG_DM_SERIAL=n
 CONFIG_DM_GPIO=n
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/pcm051_rev1_defconfig +2 -0
index 8b27682..baa2b23 100644
@@ -2,3 +2,5 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="REV1"
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_PCM051=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/pcm051_rev3_defconfig +2 -0
index 27ad6ff..b5c62a6 100644
@@ -2,3 +2,5 @@ CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="REV3"
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_PCM051=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/pengwyn_defconfig +2 -0
index 1b9aa68..cbdd404 100644
@@ -1,3 +1,5 @@
 CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_PENGWYN=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/pepper_defconfig +2 -0
index 22c7bb4..14266ef 100644
@@ -1,3 +1,5 @@
 CONFIG_SPL=y
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_PEPPER=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/rpi_defconfig +2 -0
index 9379cf0..98d3199 100644
@@ -1,2 +1,4 @@
 CONFIG_ARM=y
 CONFIG_TARGET_RPI=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/s5p_goni_defconfig +2 -0
index 618e590..33e6fb8 100644
@@ -2,3 +2,5 @@ CONFIG_ARM=y
 CONFIG_ARCH_S5PC1XX=y
 CONFIG_TARGET_S5P_GONI=y
 CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-goni"
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/sandbox_defconfig +2 -0
index 660063e..0bf5ea3 100644
@@ -5,3 +5,5 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_DM=y
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/smdkc100_defconfig +2 -0
index 041030f..e933a32 100644
@@ -2,3 +2,5 @@ CONFIG_ARM=y
 CONFIG_TARGET_SMDKC100=y
 CONFIG_ARCH_S5PC1XX=y
 CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-smdkc100"
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/snapper9260_defconfig +2 -0
index 035146c..97c49f3 100644
@@ -4,3 +4,5 @@ CONFIG_TARGET_SNAPPER9260=y
 CONFIG_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/snapper9g20_defconfig +2 -0
index 66c44cc..d5f1d9f 100644
@@ -4,3 +4,5 @@ CONFIG_TARGET_SNAPPER9260=y
 CONFIG_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x400
configs/stv0991_defconfig +2 -0
index a05e991..37b10ba 100644
@@ -1,3 +1,5 @@
 CONFIG_SYS_EXTRA_OPTIONS="stv0991"
 CONFIG_ARM=y
 CONFIG_TARGET_STV0991=y
+CONFIG_SYS_MALLOC_F=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
include/configs/cm_fx6.h +0 -3
index 0a4d93f..94ef7ab 100644
@@ -21,10 +21,7 @@
 #define CONFIG_MACH_TYPE		4273
 
 #ifndef CONFIG_SPL_BUILD
-
 #define CONFIG_CMD_GPIO
-
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 #endif
 
 /* Display information on boot */
include/configs/exynos-common.h +0 -1
index 2c4f35a..59676ae 100644
@@ -36,7 +36,6 @@
 #define CONFIG_ENV_OVERWRITE
 
 /* Size of malloc() pool before and after relocation */
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (80 << 20))
 
 /* select serial console configuration */
include/configs/gw_ventana.h +0 -1
index 4f137fc..620f950 100644
@@ -39,7 +39,6 @@
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(10 * 1024 * 1024)
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 /* Init Functions */
 #define CONFIG_BOARD_EARLY_INIT_F
include/configs/mx6sabre_common.h +0 -1
index f0f721e..80e48d1 100644
@@ -27,7 +27,6 @@
 
 #define CONFIG_DM
 #define CONFIG_DM_THERMAL
-#define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #define CONFIG_IMX6_THERMAL
 
 #define CONFIG_SYS_GENERIC_BOARD
include/configs/mx6sxsabresd.h +0 -1
index fbaae3f..2041c4b 100644
@@ -224,7 +224,6 @@
 
 #define CONFIG_DM
 #define CONFIG_DM_THERMAL
-#define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #define CONFIG_IMX6_THERMAL
 
 #define CONFIG_CMD_FUSE
include/configs/nokia_rx51.h +0 -1
index 6e1f501..46fc91e 100644
@@ -72,7 +72,6 @@
 #define CONFIG_UBI_SIZE			(512 << 10)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
 					(128 << 10))
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 /*
  * Hardware drivers
include/configs/novena.h +0 -1
index ea75d2c..074110c 100644
@@ -116,7 +116,6 @@
 #define CONFIG_SYS_MEMTEST_END		0x20000000
 
 #define CONFIG_SYS_MALLOC_LEN		(64 * 1024 * 1024)
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 /* SPL */
 #define CONFIG_SPL_FAT_SUPPORT
include/configs/rpi.h +0 -1
index ea19ad8..7ad8d08 100644
@@ -46,7 +46,6 @@
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_MALLOC_LEN		SZ_4M
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 #define CONFIG_SYS_MEMTEST_START	0x00100000
 #define CONFIG_SYS_MEMTEST_END		0x00200000
 #define CONFIG_LOADADDR			0x00200000
include/configs/s5p_goni.h +0 -1
index 26167a4..8fadc68 100644
@@ -40,7 +40,6 @@
 #define CONFIG_CMDLINE_EDITING
 
 /* Size of malloc() pool before and after relocation */
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (80 << 20))
 
 /*
include/configs/sandbox.h +0 -1
index bff0170..5c11650 100644
@@ -60,7 +60,6 @@
 /*
  * Size of malloc() pool, before and after relocation
  */
-#define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #define CONFIG_MALLOC_F_ADDR		0x0010000
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)	/* 32MB  */
 
include/configs/smdkc100.h +0 -3
index a7eb33e..080fc3a 100644
@@ -48,9 +48,6 @@
  */
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
 
-/* Small malloc pool before relocation */
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
-
 /*
  * select serial console configuration
  */
include/configs/snapper9260.h +0 -1
index 712f9b7..6c68596 100644
@@ -21,7 +21,6 @@
 #define CONFIG_SYS_AT91_MAIN_CLOCK	18432000 /* External Crystal, in Hz */
 #define CONFIG_SYS_AT91_SLOW_CLOCK	32768
 #define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 /* CPU */
 #define CONFIG_ARCH_CPU_INIT
include/configs/stv0991.h +0 -1
index fd9bd63..071b1c2 100644
@@ -28,7 +28,6 @@
 	(PHYS_SDRAM_1_SIZE - CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MAXARGS			16
 #define CONFIG_SYS_MALLOC_LEN			(CONFIG_ENV_SIZE + 16 * 1024)
-#define CONFIG_SYS_MALLOC_F_LEN			0x2000
 
 #define CONFIG_DM
 /* serial port (PL011) configuration */
include/configs/sunxi-common.h +0 -1
index 6930bf6..8b15518 100644
@@ -29,7 +29,6 @@
 
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM)
 # define CONFIG_DW_SERIAL
-# define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #endif
 
 /*
include/configs/tegra-common.h +0 -1
index ef25980..005fc6a 100644
@@ -37,7 +37,6 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN		(4 << 20)	/* 4MB  */
-#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 
 #define CONFIG_SYS_NONCACHED_MEMORY	(1 << 20)       /* 1 MiB */
 
include/configs/ti_am335x_common.h +0 -1
index 4ce9d49..20a55f4 100644
@@ -21,7 +21,6 @@
 
 #ifndef CONFIG_SPL_BUILD
 # define CONFIG_OMAP_SERIAL
-# define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #endif
 
 #include <asm/arch/omap.h>
include/configs/ti_omap3_common.h +0 -1
index 77211de..840e108 100644
@@ -20,7 +20,6 @@
 
 #ifndef CONFIG_SPL_BUILD
 # define CONFIG_OMAP_SERIAL
-# define CONFIG_SYS_MALLOC_F_LEN	(1 << 10)
 #endif
 
 /* The chip has SDRC controller */
include/configs/uniphier.h +0 -2
index 8a7a20b..35b019d 100644
@@ -80,8 +80,6 @@
 #define CONFIG_SMC911X_BASE		CONFIG_SUPPORT_CARD_ETHER_BASE
 #define CONFIG_SMC911X_32_BIT
 
-#define CONFIG_SYS_MALLOC_F_LEN  0x2000
-
 /*-----------------------------------------------------------------------
  * MMU and Cache Setting
  *----------------------------------------------------------------------*/
include/configs/x86-common.h +0 -1
index a2a70d0..ba132e9 100644
@@ -188,7 +188,6 @@
 #define CONFIG_SYS_STACK_SIZE			(32 * 1024)
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_MALLOC_LEN			0x200000
-#define CONFIG_SYS_MALLOC_F_LEN			(2 << 10)
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#45 lore raw

PATCH v2 17/19 dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to Kconfig

Hi Simon,

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 61

Quoted 3 lines · Simon Glass
Kconfig +3 -0
+config SYS_MALLOC_F
+	bool "Enable malloc() pool before relocation"
+	default 0x400

I'm wondering if default value here should be of type "bool" but not a hex value?

Probably this is just a copy paste from the following SYS_MALLOC_F_LEN?

Quoted 5 lines
Kconfig +5 -0
+	help
+	  Before relocation memory is very limited on many platforms. Still,
+	  we can provide a small malloc() pool if needed. Driver model in
+	  particular needs this to operate, so that it can allocate the
+	  initial serial device and any others that are needed.

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 76

Quoted 10 lines
Kconfig +10 -0
+
+config SYS_MALLOC_F_LEN
+	hex "Size of malloc() pool before relocation"
+	depends on SYS_MALLOC_F
+	default 0x400
+	help
+	  Before relocation memory is very limited on many platforms. Still,
+	  we can provide a small malloc() pool if needed. Driver model in
+	  particular needs this to operate, so that it can allocate the
+	  initial serial device and any others that are needed.

-Alexey

#46 lore raw

PATCH v2 17/19 dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to Kconfig

Hi Alexey,

Quoted 12 lines · Alexey Brodkin

Hi Simon,

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 61

Quoted 3 lines · Simon Glass
Kconfig +3 -0
+config SYS_MALLOC_F
+     bool "Enable malloc() pool before relocation"
+     default 0x400

I'm wondering if default value here should be of type "bool" but not a hex value?

Probably this is just a copy paste from the following SYS_MALLOC_F_LEN?

Thanks. I found another problem also but may have a solution now so will see a few patches,

Quoted 9 lines
Quoted 9 lines
Kconfig +9 -0
+     help
+       Before relocation memory is very limited on many platforms. Still,
+       we can provide a small malloc() pool if needed. Driver model in
+       particular needs this to operate, so that it can allocate the
+       initial serial device and any others that are needed.
+
+config SYS_MALLOC_F_LEN
+     hex "Size of malloc() pool before relocation"
+     depends on SYS_MALLOC_F
Quoted 8 lines

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 66

Quoted 6 lines
Kconfig +6 -0
+     default 0x400
+     help
+       Before relocation memory is very limited on many platforms. Still,
+       we can provide a small malloc() pool if needed. Driver model in
+       particular needs this to operate, so that it can allocate the
+       initial serial device and any others that are needed.

-Alexey

Regards,
Simon

#47 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

In reply to Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 configs/socfpga_socrates_defconfig | 3 +++
 include/configs/socfpga_common.h   | 7 -------
 2 files changed, 3 insertions(+), 7 deletions(-)
configs/socfpga_socrates_defconfig +3 -0
index 0f3896d..888bbb6 100644
@@ -3,3 +3,6 @@ CONFIG_SPL=y
 +S:CONFIG_TARGET_SOCFPGA_CYCLONE5=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
+CONFIG_DM=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
include/configs/socfpga_common.h +0 -7
index 6b1f967..ee227fe 100644
@@ -190,10 +190,6 @@ unsigned int cm_get_l4_sp_clk_hz(void);
  * QSPI support
  */
 #ifdef CONFIG_OF_CONTROL	/* QSPI is controlled via DT */
-#define CONFIG_CMD_DM
-#define CONFIG_DM
-#define CONFIG_DM_SPI
-#define CONFIG_DM_SPI_FLASH
 #define CONFIG_CADENCE_QSPI
 /* Enable multiple SPI NOR flash manufacturers */
 #define CONFIG_SPI_FLASH		/* SPI flash subsystem */
@@ -210,9 +206,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #endif
 
 #ifdef CONFIG_OF_CONTROL	/* DW SPI is controlled via DT */
-#define CONFIG_CMD_DM
-#define CONFIG_DM
-#define CONFIG_DM_SPI
 #define CONFIG_DESIGNWARE_SPI
 #define CONFIG_CMD_SPI
 #endif
Signature · 1 line
2.2.0.rc0.207.ga3a616c
#48 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

Hi Simon,

Quoted 17 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 configs/socfpga_socrates_defconfig | 3 +++
 include/configs/socfpga_common.h   | 7 -------
 2 files changed, 3 insertions(+), 7 deletions(-)
configs/socfpga_socrates_defconfig +0 -0
index 0f3896d..888bbb6 100644

configs/socfpga_socrates_defconfig CONFIG_SPL=y · line 8

Quoted 6 lines
configs/socfpga_socrates_defconfig +3 -0
@@ -3,3 +3,6 @@ CONFIG_SPL=y
 +S:CONFIG_TARGET_SOCFPGA_CYCLONE5=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
+CONFIG_DM=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y

Would you need to also update socfpga_cyclone5_defconfig or is that not needed?

Thanks,
Dinh

#49 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

Hi Dinh,

Quoted 15 lines · Dinh Nguyen

Hi Simon,

Quoted 12 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

 configs/socfpga_socrates_defconfig | 3 +++
 include/configs/socfpga_common.h   | 7 -------
 2 files changed, 3 insertions(+), 7 deletions(-)
Quoted 14 lines

configs/socfpga_socrates_defconfig CONFIG_SPL=y · line 8

Quoted 11 lines
configs/socfpga_socrates_defconfig +3 -0
index 0f3896d..888bbb6 100644
@@ -3,3 +3,6 @@ CONFIG_SPL=y
 +S:CONFIG_TARGET_SOCFPGA_CYCLONE5=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
+CONFIG_DM=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y

Would you need to also update socfpga_cyclone5_defconfig or is that not needed?

From what I can tell it does not use driver model yet (it doesn't define CONFIG_OF_CONTROL either).

Regards,
Simon

#50 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

Hi,

(added Marek to Cc)

Quoted 33 lines · Simon Glass

Hi Dinh,

Quoted 15 lines · Dinh Nguyen

Hi Simon,

Quoted 12 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig instead.

---

Changes in v2: None

  configs/socfpga_socrates_defconfig | 3 +++
  include/configs/socfpga_common.h   | 7 -------
  2 files changed, 3 insertions(+), 7 deletions(-)
Quoted 14 lines

configs/socfpga_socrates_defconfig CONFIG_SPL=y · line 8

Quoted 11 lines
configs/socfpga_socrates_defconfig +3 -0
index 0f3896d..888bbb6 100644
@@ -3,3 +3,6 @@ CONFIG_SPL=y
  +S:CONFIG_TARGET_SOCFPGA_CYCLONE5=y
  CONFIG_OF_CONTROL=y
  CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
+CONFIG_DM=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y

Would you need to also update socfpga_cyclone5_defconfig or is that not needed?

Quoted 2 lines

From what I can tell it does not use driver model yet (it doesn't
define CONFIG_OF_CONTROL either).

socrates was the first SoCFPGA board to use DT and DM. IIRC, Marek has a patch series queued to move the other SoCFPGA boards over to DT based probing (with DM enabled) as well.

Thanks,
Stefan

#51 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

Quoted 41 lines · Stefan Roese

Hi,

(added Marek to Cc)

Quoted 36 lines · Simon Glass

Hi Dinh,

Quoted 31 lines · Dinh Nguyen

Hi Simon,

Quoted 19 lines · Simon Glass

Remove driver model CONFIGs from the board config headers and use Kconfig
instead.

---

Changes in v2: None

  configs/socfpga_socrates_defconfig | 3 +++
  include/configs/socfpga_common.h   | 7 -------
  2 files changed, 3 insertions(+), 7 deletions(-)
configs/socfpga_socrates_defconfig +0 -0
index 0f3896d..888bbb6 100644

configs/socfpga_socrates_defconfig CONFIG_SPL=y · line 8

Quoted 6 lines
configs/socfpga_socrates_defconfig +3 -0
@@ -3,3 +3,6 @@ CONFIG_SPL=y
  +S:CONFIG_TARGET_SOCFPGA_CYCLONE5=y
  CONFIG_OF_CONTROL=y
  CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
+CONFIG_DM=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y

Would you need to also update socfpga_cyclone5_defconfig or is that not needed?

Quoted 7 lines
Quoted 2 lines

From what I can tell it does not use driver model yet (it doesn't
define CONFIG_OF_CONTROL either).

socrates was the first SoCFPGA board to use DT and DM. IIRC, Marek has a patch series queued to move the other SoCFPGA boards over to DT based probing (with DM enabled) as well.

Ah ok, thanks for the clarification.

Dinh

#52 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

Quoted 4 lines · Dinh Nguyen
Quoted 3 lines · Stefan Roese

Hi,

(added Marek to Cc)

[...]

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Would you need to also update socfpga_cyclone5_defconfig or is that not needed?

From what I can tell it does not use driver model yet (it doesn't

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

define CONFIG_OF_CONTROL either).

socrates was the first SoCFPGA board to use DT and DM. IIRC, Marek has a patch series queued to move the other SoCFPGA boards over to DT based probing (with DM enabled) as well.

Ah ok, thanks for the clarification.

Hi!

it's only DT, not DM. It's the Arria V patchset I sent out that Stefan is referring to. I'll address his comment this week and will repost then.

In case you want to base on top of that patchset, it's in the u-boot-socfpga repository, branch "topic/vip-arriav" .

Best regards,
Marek Vasut

#53 lore raw

PATCH v2 18/19 dm: socfpga: Move driver model CONFIGs to Kconfig

Quoted 23 lines · Marek Vasut
Quoted 4 lines · Dinh Nguyen
Quoted 3 lines · Stefan Roese

Hi,

(added Marek to Cc)

[...]

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Would you need to also update socfpga_cyclone5_defconfig or is that not needed?

From what I can tell it does not use driver model yet (it doesn't

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

define CONFIG_OF_CONTROL either).

socrates was the first SoCFPGA board to use DT and DM. IIRC, Marek has a patch series queued to move the other SoCFPGA boards over to DT based probing (with DM enabled) as well.

Ah ok, thanks for the clarification.

Hi!

Quoted 8 lines

it's only DT, not DM. It's the Arria V patchset I sent out that Stefan is referring to. I'll address his comment this week and will repost then.

In case you want to base on top of that patchset, it's in the u-boot-socfpga repository, branch "topic/vip-arriav" .

Best regards,
Marek Vasut

Applied to u-boot-dm.

#54 lore raw

PATCH v2 19/19 dm: Drop unused driver model config_defaults

In reply to Simon Glass

These are now in Kconfig so we can drop them from the header file.

---

Changes in v2: None

 include/config_defaults.h | 12 ------------
 1 file changed, 12 deletions(-)
include/config_defaults.h +0 -12
index fa99838..ad08c1d 100644
@@ -20,16 +20,4 @@
 #define CONFIG_ZLIB 1
 #define CONFIG_PARTITIONS 1
 
-#ifndef CONFIG_SPL_BUILD
-#ifndef CONFIG_DM_WARN
-#define CONFIG_DM_WARN
-#endif
-#ifndef CONFIG_DM_DEVICE_REMOVE
-#define CONFIG_DM_DEVICE_REMOVE
-#endif
-#ifndef CONFIG_DM_STDIO
-#define CONFIG_DM_STDIO
-#endif
-#endif
-
 #endif
Signature · 1 line
2.2.0.rc0.207.ga3a616c