Re: [U-Boot] [PATCH v3 5/7] malloc_f: enable SYS_MALLOC_F by default if DM is on

2015-03-24 Thread Robert Baldyga
On 03/19/2015 11:42 AM, Masahiro Yamada wrote:
 This option has a bool type, not hex.
 Fix it and enable it if CONFIG_DM is on because Driver Model always
 requires malloc memory.  Devices are scanned twice, before/after
 relocation.  CONFIG_SYS_MALLOC_F should be enabled to use malloc
 memory before relocation.  As it is board-independent, handle it
 globally.
 
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 Acked-by: Stephen Warren swar...@wwwdotorg.org

Acked-by: Robert Baldyga r.bald...@samsung.com

 ---
 
 Changes in v2:
   - Fix a typo   s/not board-independent/board-independent/
 
  Kconfig   | 2 +-
  arch/arm/cpu/armv7/exynos/Kconfig | 3 ---
  arch/arm/cpu/armv7/omap3/Kconfig  | 3 ---
  arch/arm/mach-tegra/Kconfig   | 3 ---
  arch/arm/mach-uniphier/Kconfig| 3 ---
  arch/x86/Kconfig  | 3 ---
  board/amcc/canyonlands/Kconfig| 4 
  board/ti/am335x/Kconfig   | 3 ---
  configs/Linksprite_pcDuino3_fdt_defconfig | 1 -
  configs/am335x_igep0033_defconfig | 1 -
  configs/cm_fx6_defconfig  | 1 -
  configs/cm_t335_defconfig | 1 -
  configs/mx6dlsabreauto_defconfig  | 1 -
  configs/mx6qsabreauto_defconfig   | 1 -
  configs/mx6qsabresd_defconfig | 1 -
  configs/mx6sxsabresd_defconfig| 1 -
  configs/nokia_rx51_defconfig  | 1 -
  configs/pcm051_rev1_defconfig | 1 -
  configs/pcm051_rev3_defconfig | 1 -
  configs/pengwyn_defconfig | 1 -
  configs/pepper_defconfig  | 1 -
  configs/rpi_2_defconfig   | 1 -
  configs/rpi_defconfig | 1 -
  configs/s5p_goni_defconfig| 1 -
  configs/sandbox_defconfig | 1 -
  configs/smdkc100_defconfig| 1 -
  configs/snapper9260_defconfig | 1 -
  configs/snapper9g20_defconfig | 1 -
  configs/stv0991_defconfig | 1 -
  include/configs/rcar-gen2-common.h| 2 --
  30 files changed, 1 insertion(+), 46 deletions(-)
 
 diff --git a/Kconfig b/Kconfig
 index 8f96c94..b5968d7 100644
 --- a/Kconfig
 +++ b/Kconfig
 @@ -54,7 +54,7 @@ config CC_OPTIMIZE_FOR_SIZE
  
  config SYS_MALLOC_F
   bool Enable malloc() pool before relocation
 - default 0x400
 + default y if DM
   help
 Before relocation memory is very limited on many platforms. Still,
 we can provide a small malloc() pool if needed. Driver model in
 diff --git a/arch/arm/cpu/armv7/exynos/Kconfig 
 b/arch/arm/cpu/armv7/exynos/Kconfig
 index 9e47ed3..bd7540a 100644
 --- a/arch/arm/cpu/armv7/exynos/Kconfig
 +++ b/arch/arm/cpu/armv7/exynos/Kconfig
 @@ -80,9 +80,6 @@ config DM_SPI_FLASH
  config DM_GPIO
   default y
  
 -config SYS_MALLOC_F
 - default y
 -
  source board/samsung/smdkv310/Kconfig
  source board/samsung/trats/Kconfig
  source board/samsung/universal_c210/Kconfig
 diff --git a/arch/arm/cpu/armv7/omap3/Kconfig 
 b/arch/arm/cpu/armv7/omap3/Kconfig
 index aa2ff46..1f96498 100644
 --- a/arch/arm/cpu/armv7/omap3/Kconfig
 +++ b/arch/arm/cpu/armv7/omap3/Kconfig
 @@ -106,9 +106,6 @@ config DM_GPIO
  config DM_SERIAL
   default y if DM
  
 -config SYS_MALLOC_F
 - default y if DM
 -
  config SYS_SOC
   default omap3
  
 diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
 index fccfd79..fce1c1d 100644
 --- a/arch/arm/mach-tegra/Kconfig
 +++ b/arch/arm/mach-tegra/Kconfig
 @@ -17,9 +17,6 @@ config TEGRA124
  
  endchoice
  
 -config SYS_MALLOC_F
 - default y
 -
  config SYS_MALLOC_F_LEN
   default 0x1800
  
 diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig
 index b6dc75f..20e20a5 100644
 --- a/arch/arm/mach-uniphier/Kconfig
 +++ b/arch/arm/mach-uniphier/Kconfig
 @@ -48,9 +48,6 @@ config DCC_MICRO_SUPPORT_CARD
  
  endchoice
  
 -config SYS_MALLOC_F
 - default y
 -
  config CMD_PINMON
   bool Enable boot mode pins monitor command
   default y
 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
 index 35d24e4..da27115 100644
 --- a/arch/x86/Kconfig
 +++ b/arch/x86/Kconfig
 @@ -76,9 +76,6 @@ config DM_GPIO
  config DM_SERIAL
   default y
  
 -config SYS_MALLOC_F
 - default y
 -
  config SYS_MALLOC_F_LEN
   default 0x800
  
 diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig
 index c0dbd18..46efa7a 100644
 --- a/board/amcc/canyonlands/Kconfig
 +++ b/board/amcc/canyonlands/Kconfig
 @@ -39,8 +39,4 @@ config DM
  config DM_SERIAL
   default y
  
 -config SYS_MALLOC_F
 - bool
 - default y
 -
  endif
 diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig
 index 8c45892..7cb006f 100644
 --- a/board/ti/am335x/Kconfig
 +++ b/board/ti/am335x/Kconfig
 @@ -47,7 +47,4 @@ config DM_GPIO
  config DM_SERIAL
   default y if DM
  
 -config SYS_MALLOC_F
 - default y if DM

Re: [U-Boot] [PATCH v3 4/7] malloc_f: remove redundant defalut values of CONFIG_SYS_MALLOC_F_LEN

2015-03-24 Thread Robert Baldyga
On 03/19/2015 11:42 AM, Masahiro Yamada wrote:
 The default value of CONFIG_SYS_MALLOC_F_LEN is defined by ./Kconfig
 as 0x400.  Each defconfig or Kconfig need not repeat the same value.
 
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 Acked-by: Stephen Warren swar...@wwwdotorg.org

Acked-by: Robert Baldyga r.bald...@samsung.com

 ---
 
 Changes in v2: None
 
  arch/arm/cpu/armv7/exynos/Kconfig | 3 ---
  arch/arm/cpu/armv7/omap3/Kconfig  | 3 ---
  arch/arm/mach-uniphier/Kconfig| 3 ---
  board/amcc/canyonlands/Kconfig| 4 
  board/ti/am335x/Kconfig   | 3 ---
  configs/Linksprite_pcDuino3_fdt_defconfig | 1 -
  configs/am335x_igep0033_defconfig | 1 -
  configs/cm_fx6_defconfig  | 1 -
  configs/cm_t335_defconfig | 1 -
  configs/gwventana_defconfig   | 1 -
  configs/mx6dlsabreauto_defconfig  | 1 -
  configs/mx6qsabreauto_defconfig   | 1 -
  configs/mx6qsabresd_defconfig | 1 -
  configs/mx6sxsabresd_defconfig| 1 -
  configs/nokia_rx51_defconfig  | 1 -
  configs/pcm051_rev1_defconfig | 1 -
  configs/pcm051_rev3_defconfig | 1 -
  configs/pengwyn_defconfig | 1 -
  configs/pepper_defconfig  | 1 -
  configs/rpi_2_defconfig   | 1 -
  configs/rpi_defconfig | 1 -
  configs/s5p_goni_defconfig| 1 -
  configs/sandbox_defconfig | 1 -
  configs/smdkc100_defconfig| 1 -
  configs/snapper9260_defconfig | 1 -
  configs/snapper9g20_defconfig | 1 -
  26 files changed, 37 deletions(-)
 
 diff --git a/arch/arm/cpu/armv7/exynos/Kconfig 
 b/arch/arm/cpu/armv7/exynos/Kconfig
 index eb86a7f..9e47ed3 100644
 --- a/arch/arm/cpu/armv7/exynos/Kconfig
 +++ b/arch/arm/cpu/armv7/exynos/Kconfig
 @@ -83,9 +83,6 @@ config DM_GPIO
  config SYS_MALLOC_F
   default y
  
 -config SYS_MALLOC_F_LEN
 - default 0x400
 -
  source board/samsung/smdkv310/Kconfig
  source board/samsung/trats/Kconfig
  source board/samsung/universal_c210/Kconfig
 diff --git a/arch/arm/cpu/armv7/omap3/Kconfig 
 b/arch/arm/cpu/armv7/omap3/Kconfig
 index 65da6e2..aa2ff46 100644
 --- a/arch/arm/cpu/armv7/omap3/Kconfig
 +++ b/arch/arm/cpu/armv7/omap3/Kconfig
 @@ -109,9 +109,6 @@ config DM_SERIAL
  config SYS_MALLOC_F
   default y if DM
  
 -config SYS_MALLOC_F_LEN
 - default 0x400 if DM
 -
  config SYS_SOC
   default omap3
  
 diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig
 index 8335685..b6dc75f 100644
 --- a/arch/arm/mach-uniphier/Kconfig
 +++ b/arch/arm/mach-uniphier/Kconfig
 @@ -51,9 +51,6 @@ endchoice
  config SYS_MALLOC_F
   default y
  
 -config SYS_MALLOC_F_LEN
 - default 0x400
 -
  config CMD_PINMON
   bool Enable boot mode pins monitor command
   default y
 diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig
 index 848e08f..c0dbd18 100644
 --- a/board/amcc/canyonlands/Kconfig
 +++ b/board/amcc/canyonlands/Kconfig
 @@ -43,8 +43,4 @@ config SYS_MALLOC_F
   bool
   default y
  
 -config SYS_MALLOC_F_LEN
 - hex
 - default 0x400
 -
  endif
 diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig
 index 722f9d5..8c45892 100644
 --- a/board/ti/am335x/Kconfig
 +++ b/board/ti/am335x/Kconfig
 @@ -50,7 +50,4 @@ config DM_SERIAL
  config SYS_MALLOC_F
   default y if DM
  
 -config SYS_MALLOC_F_LEN
 - default 0x400 if DM
 -
  endif
 diff --git a/configs/Linksprite_pcDuino3_fdt_defconfig 
 b/configs/Linksprite_pcDuino3_fdt_defconfig
 index 1504664..87dd38f 100644
 --- a/configs/Linksprite_pcDuino3_fdt_defconfig
 +++ b/configs/Linksprite_pcDuino3_fdt_defconfig
 @@ -14,4 +14,3 @@ CONFIG_DRAM_CLK=480
  CONFIG_DRAM_ZQ=122
  CONFIG_DRAM_EMR1=4
  CONFIG_SYS_MALLOC_F=y
 -CONFIG_SYS_MALLOC_F_LEN=0x400
 diff --git a/configs/am335x_igep0033_defconfig 
 b/configs/am335x_igep0033_defconfig
 index 8d38e26..a439298 100644
 --- a/configs/am335x_igep0033_defconfig
 +++ b/configs/am335x_igep0033_defconfig
 @@ -4,4 +4,3 @@ CONFIG_SPL_STACK_R_ADDR=0x8200
  CONFIG_ARM=y
  CONFIG_TARGET_AM335X_IGEP0033=y
  CONFIG_SYS_MALLOC_F=y
 -CONFIG_SYS_MALLOC_F_LEN=0x400
 diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
 index 2fd21cf..00cbdd2 100644
 --- a/configs/cm_fx6_defconfig
 +++ b/configs/cm_fx6_defconfig
 @@ -6,4 +6,3 @@ CONFIG_DM=y
  CONFIG_DM_GPIO=y
  CONFIG_DM_SERIAL=y
  CONFIG_SYS_MALLOC_F=y
 -CONFIG_SYS_MALLOC_F_LEN=0x400
 diff --git a/configs/cm_t335_defconfig b/configs/cm_t335_defconfig
 index 086e526..31705f2 100644
 --- a/configs/cm_t335_defconfig
 +++ b/configs/cm_t335_defconfig
 @@ -2,4 +2,3 @@ CONFIG_SPL=y
  CONFIG_ARM=y
  CONFIG_TARGET_CM_T335=y
  CONFIG_SYS_MALLOC_F=y
 -CONFIG_SYS_MALLOC_F_LEN=0x400
 diff --git a/configs/gwventana_defconfig b/configs/gwventana_defconfig
 index 6eab019..d6bbdc1 100644
 --- a/configs

Re: [U-Boot] [PATCH v2 04/12] dm: pmic: add implementation of driver model regulator uclass

2015-03-10 Thread Robert Baldyga
Hi,

On 03/03/2015 05:24 PM, Przemyslaw Marczak wrote:
 This is the implementation of driver model regulator uclass api.
 To use it, the CONFIG_DM_PMIC is required with driver implementation,
 since it provides pmic devices basic I/O API.
 
 The regulator framework is based on a 'struct dm_regulator_ops'.
 It provides a common function calls, for it's basic features:
 - regulator_get_cnt()- number of outputs each type
 - regulator_get_value_desc() - describe output value limits
 - regulator_get_mode_desc()  - describe output operation modes
 - regulator_get/set_value()  - output value (uV)
 - regulator_get/set_state()  - output on/off state
 - regulator_get/set_mode()   - output operation mode
 
 To get the regulator device:
 - regulator_get() - by name only
 - regulator_i2c_get() - by i2c bus address (of pmic parent)
 - regulator_spi_get() - by spi bus address (of pmic parent)
 
 An optional and useful regulator framework features are two descriptors:
 - struct regulator_desc - describes the regulator name and output value limits
   should be defined by device driver for each regulator output.
 
 - struct regulator_mode_desc - (array) describes a number of operation modes
   supported by each regulator output.
 
 The regulator framework features are described in file:
 - include/power/regulator.h
 
 Main files:
 - drivers/power/regulator-uclass.c - provides regulator common functions api
 - include/power/regulator.h - define all structures required by the regulator
 
 Changes:
 - new uclass-id: UCLASS_PMIC_REGULATOR
 - new config: CONFIG_DM_REGULATOR
 
 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 ---
 Changes V2:
 - new operations for regulator uclass:
 -- get/set output state - for output on/off setting
 --- add enum: REGULATOR_OFF, REGULATOR_ON
 
 - regulator uclass code rework and cleanup:
 -- change name of:
 --- enum 'regulator_desc_type' to 'regulator_type'
 --- add type DVS
 --- struct 'regulator_desc' to 'regulator_value_desc'
 
 -- regulator ops function calls:
 --- remove 'ldo/buck' from naming
 --- add new argument 'type' for define regulator type
 
 -- regulator.h - update comments
 ---
  drivers/power/Makefile   |   1 +
  drivers/power/regulator-uclass.c | 227 
  include/dm/uclass-id.h   |   1 +
  include/power/regulator.h| 310 
 +++
  4 files changed, 539 insertions(+)
  create mode 100644 drivers/power/regulator-uclass.c
  create mode 100644 include/power/regulator.h
 
 diff --git a/drivers/power/Makefile b/drivers/power/Makefile
 index 5c9a189..a6b7012 100644
 --- a/drivers/power/Makefile
 +++ b/drivers/power/Makefile
 @@ -22,3 +22,4 @@ obj-$(CONFIG_POWER_FSL) += power_fsl.o
  obj-$(CONFIG_POWER_I2C) += power_i2c.o
  obj-$(CONFIG_POWER_SPI) += power_spi.o
  obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
 +obj-$(CONFIG_DM_REGULATOR) += regulator-uclass.o
 diff --git a/drivers/power/regulator-uclass.c 
 b/drivers/power/regulator-uclass.c
 new file mode 100644
 index 000..6b5c678
 --- /dev/null
 +++ b/drivers/power/regulator-uclass.c
 @@ -0,0 +1,227 @@
 +/*
 + * Copyright (C) 2014-2015 Samsung Electronics
 + * Przemyslaw Marczak p.marc...@samsung.com
 + *
 + * SPDX-License-Identifier:  GPL-2.0+
 + */
 +#include common.h
 +#include linux/types.h
 +#include fdtdec.h
 +#include dm.h
 +#include power/pmic.h
 +#include power/regulator.h
 +#include compiler.h
 +#include dm/device.h
 +#include dm/lists.h
 +#include dm/device-internal.h
 +#include errno.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +int regulator_get_cnt(struct udevice *dev, int type, int *cnt)
 +{
 + const struct dm_regulator_ops *ops;
 +
 + ops = pmic_get_uclass_ops(dev, UCLASS_PMIC_REGULATOR);
 + if (!ops)
 + return -ENODEV;
 +
 + if (!ops-get_cnt)
 + return -EPERM;
 +
 + return ops-get_cnt(dev, type, cnt);
 +}
 +
 +int regulator_get_value_desc(struct udevice *dev, int type, int number,
 +  struct regulator_value_desc **desc)
 +{
 + const struct dm_regulator_ops *ops;
 +
 + ops = pmic_get_uclass_ops(dev, UCLASS_PMIC_REGULATOR);
 + if (!ops)
 + return -ENXIO;
 +
 + if (!ops-get_value_desc)
 + return -EPERM;
 +
 + return ops-get_value_desc(dev, type, number, desc);
 +}
 +
 +int regulator_get_mode_desc(struct udevice *dev, int type, int number,
 + int *mode_cnt, struct regulator_mode_desc **desc)
 +{
 + const struct dm_regulator_ops *ops;
 +
 + ops = pmic_get_uclass_ops(dev, UCLASS_PMIC_REGULATOR);
 + if (!ops)
 + return -ENXIO;
 +
 + if (!ops-get_mode_desc_array)
 + return -EPERM;
 +
 + return ops-get_mode_desc_array(dev, type, number, mode_cnt, desc);
 +}
 +
 +int regulator_get_value(struct udevice *dev, int type, int number, int 
 *value)
 +{
 + const struct dm_regulator_ops *ops;
 +
 + ops = pmic_get_uclass_ops(dev, UCLASS_PMIC_REGULATOR);
 + 

Re: [U-Boot] [PATCH] ext4: goni: Modify dfu_alt_info's file names to have absolute path

2014-11-07 Thread Robert Baldyga
On 11/04/2014 05:21 PM, Lukasz Majewski wrote:
 After the clean up performed in the commit 1151b7ac10b81ecbb the DFU
 subsystem requires absolute patch for correct operation.

s/patch/path

 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com

Acked-by: Robert Baldyga r.bald...@samsung.com

 ---
  include/configs/s5p_goni.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
 index 0c6e9c7..8ae3e64 100644
 --- a/include/configs/s5p_goni.h
 +++ b/include/configs/s5p_goni.h
 @@ -121,8 +121,8 @@
  
  #define CONFIG_DFU_ALT \
   u-boot raw 0x80 0x400; \
 - uImage ext4 0 2; \
 - exynos3-goni.dtb ext4 0 2; \
 + /uImage ext4 0 2; \
 + /exynos3-goni.dtb ext4 0 2; \
   PARTS_ROOT part 0 5\0
  
  #define PARTS_DEFAULT \
 

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 08/12] dm: exynos: Move s5p_goni to generic board

2014-10-08 Thread Robert Baldyga
On 10/08/2014 01:36 PM, Minkyu Kang wrote:
 Dear Robert Baldyga,
 
 On 29/09/14 15:06, Robert Baldyga wrote:
 On 09/15/2014 12:29 AM, Simon Glass wrote:
 The generic board deadline is approaching, and we need this feature to
 enable driver model. Enable CONFIG_SYS_GENERIC_BOARD for s5p_goni.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

 Changes in v8:
 - Add new patch to move s5p_goni to generic board

 Changes in v7: None
 Changes in v6: None
 Changes in v5: None
 Changes in v4: None

  include/configs/s5p_goni.h | 2 ++
  1 file changed, 2 insertions(+)

 diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
 index ec78b6e..b7d9cb7 100644
 --- a/include/configs/s5p_goni.h
 +++ b/include/configs/s5p_goni.h
 @@ -289,4 +289,6 @@
  #define CONFIG_OF_SEPARATE
  #define CONFIG_OF_LIBFDT
  
 +#define CONFIG_SYS_GENERIC_BOARD
 +
  #endif /* __CONFIG_H */


 Acked-by: Robert Baldyga r.bald...@samsung.com

 
 Then how's your patch?
 http://patchwork.ozlabs.org/patch/390306/
 
 Thanks,
 Minkyu Kang.
 

Please discard my patch. Simon's patch should be applied.

Thanks,
Robert Baldyga.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: goni: add i2c_init_board()

2014-10-06 Thread Robert Baldyga
Add proper initialization of GPIO pins used by software i2c.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---

Hi Simon,

This patch is intended for your gpio-working branch. It seems that this
is only thing which is missing to make your changes working on Goni platform
(excepting patches changing cache and memory configuration which doesn't
depend on dm, and will probably be added through samsung tree).

Best regards,
Robert Baldyga

 board/samsung/goni/goni.c  | 10 ++
 include/configs/s5p_goni.h |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 22f4995..58cf96e 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -33,6 +33,16 @@ int board_init(void)
return 0;
 }
 
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+void i2c_init_board(void)
+{
+   gpio_request(S5PC110_GPIO_J43, i2c_clk);
+   gpio_request(S5PC110_GPIO_J40, i2c_data);
+   gpio_direction_output(S5PC110_GPIO_J43, 1);
+   gpio_direction_output(S5PC110_GPIO_J40, 1);
+}
+#endif
+
 int power_init_board(void)
 {
int ret;
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index fb1a7db..76b0503 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -276,6 +276,8 @@
 #define CONFIG_SYS_I2C_SOFT_SPEED  5
 #define CONFIG_SYS_I2C_SOFT_SLAVE  0x7F
 #define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C_INIT_BOARD
+
 #define CONFIG_SYS_MAX_I2C_BUS 7
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v8 08/12] dm: exynos: Move s5p_goni to generic board

2014-09-29 Thread Robert Baldyga
On 09/15/2014 12:29 AM, Simon Glass wrote:
 The generic board deadline is approaching, and we need this feature to
 enable driver model. Enable CONFIG_SYS_GENERIC_BOARD for s5p_goni.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 
 Changes in v8:
 - Add new patch to move s5p_goni to generic board
 
 Changes in v7: None
 Changes in v6: None
 Changes in v5: None
 Changes in v4: None
 
  include/configs/s5p_goni.h | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
 index ec78b6e..b7d9cb7 100644
 --- a/include/configs/s5p_goni.h
 +++ b/include/configs/s5p_goni.h
 @@ -289,4 +289,6 @@
  #define CONFIG_OF_SEPARATE
  #define CONFIG_OF_LIBFDT
  
 +#define CONFIG_SYS_GENERIC_BOARD
 +
  #endif   /* __CONFIG_H */
 

Acked-by: Robert Baldyga r.bald...@samsung.com

Thanks,
Robert Baldyga
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 13/16] samsung: Enable device tree for s5p_goni

2014-09-19 Thread Robert Baldyga
 controller */
 + PINMUX_FLAG_BANK= 3  0,   /* bank number (0-3) */
 + PINMUX_FLAG_16BIT   = 1  2,   /* 16-bit width */
 +};
 +
 +/**
 + * Configures the pinmux for a particular peripheral.
 + *
 + * Each gpio can be configured in many different ways (4 bits on exynos)
 + * such as input, output, special function, external interrupt
 + * etc. This function will configure the peripheral pinmux along with
 + * pull-up/down and drive strength.
 + *
 + * @param peripheral peripheral to be configured
 + * @param flags  configure flags
 + * @return 0 if ok, -1 on error (e.g. unsupported peripheral)
 + */
 +int exynos_pinmux_config(int peripheral, int flags);
 +
 +/**
 + * Decode the peripheral id using the interrpt numbers.
 + *
 + * @param blob  Device tree blob
 + * @param node  FDT I2C node to find
 + * @return peripheral id if ok, PERIPH_ID_NONE on error
 + */
 +int pinmux_decode_periph_id(const void *blob, int node);
 +#endif
 diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
 index 2ff0ec2..637dd97 100644
 --- a/drivers/mmc/s5p_sdhci.c
 +++ b/drivers/mmc/s5p_sdhci.c
 @@ -14,9 +14,7 @@
  #include asm/arch/mmc.h
  #include asm/arch/clk.h
  #include errno.h
 -#ifdef CONFIG_OF_CONTROL
  #include asm/arch/pinmux.h
 -#endif
  
  static char *S5P_NAME = SAMSUNG SDHCI;
  static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
 diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
 index a51215d..b22ac18 100644
 --- a/include/configs/s5p_goni.h
 +++ b/include/configs/s5p_goni.h
 @@ -53,6 +53,7 @@
  #define CONFIG_MMC
  #define CONFIG_SDHCI
  #define CONFIG_S5P_SDHCI
 +#define SDHCI_MAX_HOSTS  4
  
  /* PWM */
  #define CONFIG_PWM   1
 @@ -106,7 +107,6 @@
   ,12m(modem)\
   ,60m(qboot)\0
  
 -#define CONFIG_BOOTDELAY 1
  #define CONFIG_ZERO_BOOTDELAY_CHECK
  
  /* partitions definitions */
 @@ -283,4 +283,9 @@
  #define CONFIG_CMD_USB_MASS_STORAGE
  #define CONFIG_USB_GADGET_MASS_STORAGE
  
 +#define CONFIG_DEFAULT_DEVICE_TREE   s5pc1xx-goni
 +#define CONFIG_OF_CONTROL
 +#define CONFIG_OF_SEPARATE
 +#define CONFIG_OF_LIBFDT
 +
  #endif   /* __CONFIG_H */
 

Thanks,
Robert Baldyga
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] armv7: s5pc1xx: improve cache handling

2014-09-19 Thread Robert Baldyga
Move cache handling code to C file, and add enable_caches() and
disable_caches() functions.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 arch/arm/cpu/armv7/s5pc1xx/cache.S | 30 
 arch/arm/cpu/armv7/s5pc1xx/cache.c | 47 ++
 2 files changed, 47 insertions(+), 30 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/s5pc1xx/cache.S
 create mode 100644 arch/arm/cpu/armv7/s5pc1xx/cache.c

diff --git a/arch/arm/cpu/armv7/s5pc1xx/cache.S 
b/arch/arm/cpu/armv7/s5pc1xx/cache.S
deleted file mode 100644
index 3089592..000
--- a/arch/arm/cpu/armv7/s5pc1xx/cache.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2009 Samsung Electronics
- * Minkyu Kang mk7.k...@samsung.com
- *
- * based on arch/arm/cpu/armv7/omap3/cache.S
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-.align 5
-
-#include linux/linkage.h
-
-#ifndef CONFIG_SYS_L2CACHE_OFF
-ENTRY(v7_outer_cache_enable)
-   push{r0, r1, r2, lr}
-   mrc 15, 0, r3, cr1, cr0, 1
-   orr r3, r3, #2
-   mcr 15, 0, r3, cr1, cr0, 1
-   pop {r1, r2, r3, pc}
-ENDPROC(v7_outer_cache_enable)
-
-ENTRY(v7_outer_cache_disable)
-   push{r0, r1, r2, lr}
-   mrc 15, 0, r3, cr1, cr0, 1
-   bic r3, r3, #2
-   mcr 15, 0, r3, cr1, cr0, 1
-   pop {r1, r2, r3, pc}
-ENDPROC(v7_outer_cache_disable)
-#endif
diff --git a/arch/arm/cpu/armv7/s5pc1xx/cache.c 
b/arch/arm/cpu/armv7/s5pc1xx/cache.c
new file mode 100644
index 000..51af299
--- /dev/null
+++ b/arch/arm/cpu/armv7/s5pc1xx/cache.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ * Minkyu Kang mk7.k...@samsung.com
+ * Robert Baldyga r.bald...@samsung.com
+ *
+ * based on arch/arm/cpu/armv7/omap3/cache.S
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+   dcache_enable();
+}
+
+void disable_caches(void)
+{
+   dcache_disable();
+}
+#endif
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+void v7_outer_cache_enable(void)
+{
+   __asm(
+   push{r0, r1, r2, lr}\n\t
+   mrc 15, 0, r3, cr1, cr0, 1\n\t
+   orr r3, r3, #2\n\t
+   mcr 15, 0, r3, cr1, cr0, 1\n\t
+   pop {r1, r2, r3, pc}
+   );
+}
+
+void v7_outer_cache_disable(void)
+{
+   __asm(
+   push{r0, r1, r2, lr}\n\t
+   mrc 15, 0, r3, cr1, cr0, 1\n\t
+   bic r3, r3, #2\n\t
+   mcr 15, 0, r3, cr1, cr0, 1\n\t
+   pop {r1, r2, r3, pc}
+   );
+}
+#endif
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] dm: avoid dev-req_seq overflow

2014-09-18 Thread Robert Baldyga
Since dev-req_seq value is initialized from reg property of fdt node,
there is posibility, that address value contained in fdt is greater than
INT_MAX, and then value in dev-req_seq is negative which led to probe()
fail.

This patch fix this problem by ensuring that req_seq is positive, unless
it's one of errno codes.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/core/device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index 166b073..35ffce0 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -107,6 +107,8 @@ int device_bind(struct udevice *parent, struct driver *drv, 
const char *name,
 * when the device is probed.
 */
dev-req_seq = fdtdec_get_int(gd-fdt_blob, of_offset, reg, -1);
+   if (!IS_ERR_VALUE(dev-req_seq))
+   dev-req_seq = INT_MAX;
dev-seq = -1;
if (uc-uc_drv-name  of_offset != -1) {
fdtdec_get_alias_seq(gd-fdt_blob, uc-uc_drv-name, of_offset,
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dm: avoid dev-req_seq overflow

2014-09-18 Thread Robert Baldyga
On 09/18/2014 08:00 PM, Simon Glass wrote:
 Hi Robert,
 
 On 18 September 2014 09:13, Robert Baldyga r.bald...@samsung.com
 mailto:r.bald...@samsung.com wrote:
 
 Since dev-req_seq value is initialized from reg property of fdt node,
 there is posibility, that address value contained in fdt is greater than
 INT_MAX, and then value in dev-req_seq is negative which led to probe()
 fail.
 
 This patch fix this problem by ensuring that req_seq is positive, unless
 it's one of errno codes.
 
 
 Wouldn't this be a bug in the device tree file? What does it mean to
 have a -ve value?
 

Device tree seems to be ok. We have:

pinctrl0: pinctrl@e020 {
compatible = samsung,s5pc110-pinctrl;
reg = 0xe020 0x1000;
};

So when we take address from reg as dev-req_seq, then value
0xe020 after casting to int gives -534773760. Function
uclass_resolve_seq() returns it as proper seq number, because it's
unique. But then in file drivers/core/device.c, in function
device_probe() we have:

seq = uclass_resolve_seq(dev);
if (seq  0) {
ret = seq;
goto fail;
}

And it will obviously fail.

Using reg value as req_seq doesn't work when this value is greater
than INT_MAX.

 
 Signed-off-by: Robert Baldyga r.bald...@samsung.com
 mailto:r.bald...@samsung.com
 ---
  drivers/core/device.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/core/device.c b/drivers/core/device.c
 index 166b073..35ffce0 100644
 --- a/drivers/core/device.c
 +++ b/drivers/core/device.c
 @@ -107,6 +107,8 @@ int device_bind(struct udevice *parent, struct
 driver *drv, const char *name,
  * when the device is probed.
  */
 dev-req_seq = fdtdec_get_int(gd-fdt_blob, of_offset,
 reg, -1);
 +   if (!IS_ERR_VALUE(dev-req_seq))
 +   dev-req_seq = INT_MAX;
 dev-seq = -1;
 if (uc-uc_drv-name  of_offset != -1) {
 fdtdec_get_alias_seq(gd-fdt_blob, uc-uc_drv-name,
 of_offset,
 --
 1.9.1
 

Thanks,
Robert Baldyga
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] arm: goni: update SDRAM memory layout

2014-09-17 Thread Robert Baldyga
According to changes in memory configuration in first stage bootloader,
we change PHYS_SDRAM_1 from 0x3000 to 0x2000. This change revealed
problem in memory handling at goni platform, so this patch fix this problem
by changing CONFIG_SYS_SDRAM_BASE to 0x4000.

So far SDRAM base was set to 0x3000 and total memory size was calulated
as sum of memory sizes in all banks. But at goni platform memory address
range is not continuous.

We have:
0x2000-0x24ff - 80 MiB
0x2500-0x3fff - gap
0x4000-0x4fff - 256 MiB
0x5000-0x57ff - 128 MiB

It caused problem - u-boot has seen memory area as continous, so it
could try to read/write to memory address in the gap range.

The solution would be to create algorithm of handling non-continous memory
area, but it's much simpler to omit the first memory range and gap between
0x2500-0x3fff, and set memory base to 0x4000. It decreases
total available memory size from 464 MiB to 384 MiB, but after all we
have still more than enough memory for each u-boot feature.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 board/samsung/goni/goni.c  | 3 +--
 include/configs/s5p_goni.h | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index eb0f9bf..9aceb2e 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -50,8 +50,7 @@ int power_init_board(void)
 
 int dram_init(void)
 {
-   gd-ram_size = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE +
-   PHYS_SDRAM_3_SIZE;
+   gd-ram_size = PHYS_SDRAM_2_SIZE + PHYS_SDRAM_3_SIZE;
 
return 0;
 }
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 82bd212..eab9288 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -29,10 +29,10 @@
 #define CONFIG_SYS_CLK_FREQ_C110   2400
 
 /* DRAM Base */
-#define CONFIG_SYS_SDRAM_BASE  0x3000
+#define CONFIG_SYS_SDRAM_BASE  0x4000
 
 /* Text Base */
-#define CONFIG_SYS_TEXT_BASE   0x3480
+#define CONFIG_SYS_TEXT_BASE   0x4180
 
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
@@ -220,7 +220,7 @@
 
 /* Goni has 3 banks of DRAM, but swap the bank */
 #define CONFIG_NR_DRAM_BANKS   3
-#define PHYS_SDRAM_1   CONFIG_SYS_SDRAM_BASE   /* OneDRAM Bank #0 */
+#define PHYS_SDRAM_1   0x2000  /* OneDRAM Bank #0 */
 #define PHYS_SDRAM_1_SIZE  (80  20)  /* 80 MB in Bank #0 */
 #define PHYS_SDRAM_2   0x4000  /* mDDR DMC1 Bank #1 */
 #define PHYS_SDRAM_2_SIZE  (256  20) /* 256 MB in Bank #1 */
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] Fixes and updates for goni platform

2014-09-17 Thread Robert Baldyga
This patchset modifies goni platform configuration to make it working
with latest version of first stage bootloader. There were some memory
controller configuraion modifications, so we update SDRAM memory base,
memory banks and environmental variables to be correct with new memory
layout.

As described changes helped to reveal bug in memory handling at goni
platform, this patch series contains also fix for this bug - now we
avoid having gap in used memory area.

Detailed description of changes can be found in commit messages.

Best regards
Robert Baldyga

Robert Baldyga (3):
  arm: goni: make board generic
  arm: goni: update SDRAM memory layout
  arm: goni: update environmental variables

 board/samsung/goni/goni.c  |  3 +--
 include/configs/s5p_goni.h | 21 +++--
 2 files changed, 12 insertions(+), 12 deletions(-)

-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] arm: goni: make board generic

2014-09-17 Thread Robert Baldyga
Define CONFIG_SYS_GENERIC_BOARD to make board generic.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 include/configs/s5p_goni.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index a51215d..82bd212 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -23,6 +23,7 @@
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_SYS_GENERIC_BOARD
 
 /* input clock of PLL: has 24MHz input clock at S5PC110 */
 #define CONFIG_SYS_CLK_FREQ_C110   2400
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3] arm: goni: update environmental variables

2014-09-17 Thread Robert Baldyga
According to changes in memory configuration in first stage bootloader,
memory in address range 0x3000-0x3500 is no longer available.
It has moved to 0x2000-0x2500 to make DRAM base for kernel
the same as in another platforms based on s5pv210 SoC.

Because this memory bank is not currently used by u-boot we have only
to change addresses used in default environmental variables to be sure
that operations like kernel loading will be done at correct address in
memory.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 include/configs/s5p_goni.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index eab9288..97891b0 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -149,7 +149,7 @@
CONFIG_COMMON_BOOT
 
 #define CONFIG_UPDATEB updateb=onenand erase 0x0 0x10; \
-onenand write 0x32008000 0x0 0x10\0
+onenand write 0x22008000 0x0 0x10\0
 
 #define CONFIG_MISC_COMMON
 #define CONFIG_MISC_INIT_R
@@ -162,13 +162,13 @@
CONFIG_UPDATEB \
updatek= \
onenand erase 0xc0 0x60; \
-   onenand write 0x31008000 0xc0 0x60\0 \
+   onenand write 0x21008000 0xc0 0x60\0 \
updateu= \
onenand erase 0x0156 0x1eaa; \
-   onenand write 0x3200 0x126 0x8C\0 \
+   onenand write 0x2200 0x126 0x8C\0 \
bootk= \
run loaduimage; \
-   bootm 0x30007FC0\0 \
+   bootm 0x20007FC0\0 \
flashboot= \
set bootargs root=/dev/mtdblock${bootblock}  \
rootfstype=${rootfstype} ${opts}  \
@@ -180,10 +180,10 @@
tftpboot= \
set bootargs root=ubi0!rootfs rootfstype=ubifs  \
${opts} ${lcdinfo}  CONFIG_COMMON_BOOT \
-   ; tftp 0x30007FC0 uImage; bootm 0x30007FC0\0 \
+   ; tftp 0x20007FC0 uImage; bootm 0x20007FC0\0 \
ramboot= \
set bootargs  CONFIG_RAMDISK_BOOT \
-   initrd=0x3300,8M ramdisk=8192\0 \
+   initrd=0x2300,8M ramdisk=8192\0 \
mmcboot= \
set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart}  \
rootfstype=${rootfstype} ${opts} ${lcdinfo}  \
@@ -194,7 +194,7 @@
rootfstype=ext4\0 \
console= CONFIG_DEFAULT_CONSOLE \
meminfo=mem=80M mem=256M@0x4000 mem=128M@0x5000\0 \
-   loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0 \
+   loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x20007FC0 uImage\0 \
mmcdev=0\0 \
mmcbootpart=2\0 \
mmcrootpart=5\0 \
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] samsung: s5p_goni: fix: Add missing definitions for G_DNL_UMS gadget

2014-08-22 Thread Robert Baldyga
On 08/22/2014 09:12 AM, Lukasz Majewski wrote:
 The commit (SHA1: 8fc171318e352) reintroduced correct values for vendor and
 product IDs required for UMS gadget to work properly either at Windows or
 Linux.
 
 This data was missing for GONI target, so this commit corrects this mistake.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 ---
  include/configs/s5p_goni.h | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
 index 6e795bf..a51215d 100644
 --- a/include/configs/s5p_goni.h
 +++ b/include/configs/s5p_goni.h
 @@ -91,6 +91,8 @@
  #define CONFIG_G_DNL_PRODUCT_NUM 0x6601
  #define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_VENDOR_NUM
  #define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D
 +#define CONFIG_G_DNL_UMS_VENDOR_NUM 0x0525
 +#define CONFIG_G_DNL_UMS_PRODUCT_NUM 0xA4A5
  #define CONFIG_G_DNL_MANUFACTURER Samsung
  
  /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
 

Acked-by: Robert Baldyga r.bald...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot