[U-Boot] [PATCH] arm:board:exynos4: add CONFIG_SYS_GENERIC_BOARD

2014-05-22 Thread Piotr Wilczek
Add CONFIG_SYS_GENERIC_BOARD for all Exynos4 boards.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com

Cc: Przemyslaw Marczak p.marc...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 include/configs/exynos4-dt.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/exynos4-dt.h b/include/configs/exynos4-dt.h
index 0c560ae..44e6ab4 100644
--- a/include/configs/exynos4-dt.h
+++ b/include/configs/exynos4-dt.h
@@ -20,6 +20,7 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_BOARD_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
 
 /* Enable fdt support */
 #define CONFIG_OF_CONTROL
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH v12 0/2] S5P: Exynos: Add GPIO numbering feature

2014-05-06 Thread Piotr Wilczek

On 05/06/2014 04:36 PM, Akshay Saraswat wrote:

Used a script to recheck/verify pin mapping and existing mapping
appears to be fine, returning correct bank and pin values.
Did ./MAKEALL -a arm and found all Exynos/S5P related boards
compiled successfully.
Couldn't test booting over all of them.
Tested U-Boot bootup over SMDK5420, SMDK5250, Snow.
Requesting maintaners to please test over affected SoCs/boards.

Changes in V2:
- Enabled CMD_GPIO as suggested by Simon Glass
  and supported same for EXYNOS5.
Changes in V3:
- New patch added to rename S5P GPIO definitions
  to S5P_GPIO.
- GPIO Table added to calculate the base address
  of input gpio bank.
Changes in V4:
- To have consistent 0..n-1 GPIO numbering the banks
  are divided into different parts where ever they
  have holes in them.
- Function and table to support gpio command moved
  to s5p-gpio driver.
- Rebased on latest u-boot-samsung tree.
Changes in V5:
- Rebased on latest u-boot-samsung tree.
- Removed Exynos5 specific code in gpio driver api to
  get bank.
- Added #define HAVE_GENERIC_GPIO in config file
  to remove conditinal CPU check in gpio driver.
Changes in V6:
- Isolated config changes in a new patch.
- Updated patches with corresponding changes for Exynos 5420.
Changes in V7:
- Added changes for other SoCs like Exynos 4412, 4210 etc.
Changes in V8:
- Changed Subject of patch 2/2 to reflect affected SoCs/boards.
- Fixed arndale board compile time errors introduced due to
  patch-set v7.
Changes in V9:
- Fixed checkpatch errors.
- Fixed naming error in exynos_gpio_data arrays which could
  be the possible reason behind data abort witnessed over
  Exynos4 boards.
Changes in v10:
- Made arch-exynos/gpio.h - arch/gpio.h.
- Removed dead code.
- Replaced exynos_gpio_get calls with corresponding pin number.
- Edited pin numbmers in dts files.
Changes in v11:
- Created and fixed pinmux_config for Exynos 4412.
- Removed dead code.
Changes in v12:
- Added change logs in individual patches.
- Fixed few bugs and typos.
- Added Acked-by: Przemyslaw Marczak.

Akshay Saraswat (2):
   S5P: Exynos: Add GPIO pin numbering and rename definitions
   S5P: Exynos: Config: Enable GPIO CMD config

  arch/arm/cpu/armv7/exynos/pinmux.c |  561 +
  arch/arm/dts/exynos4210-origen.dts |4 +-
  arch/arm/dts/exynos4210-trats.dts  |6 +-
  arch/arm/dts/exynos4210-universal_c210.dts |4 +-
  arch/arm/dts/exynos4412-trats2.dts |4 +-
  arch/arm/include/asm/arch-exynos/cpu.h |   17 +-
  arch/arm/include/asm/arch-exynos/gpio.h| 1761 +++-
  arch/arm/include/asm/arch-s5pc1xx/gpio.h   |  948 ---
  board/samsung/arndale/arndale.c|   11 +-
  board/samsung/goni/goni.c  |   32 +-
  board/samsung/smdk5250/exynos5-dt.c|   20 +-
  board/samsung/smdk5250/smdk5250.c  |   19 +-
  board/samsung/smdk5420/smdk5420.c  |   15 +-
  board/samsung/smdkc100/smdkc100.c  |5 +-
  board/samsung/smdkv310/smdkv310.c  |   19 +-
  board/samsung/trats/trats.c|   39 +-
  board/samsung/trats2/trats2.c  |   74 +-
  board/samsung/universal_c210/universal.c   |   51 +-
  drivers/gpio/s5p_gpio.c|  204 +++-
  include/configs/exynos5-dt.h   |2 +
  include/configs/s5p_goni.h |4 +-
  include/configs/s5pc210_universal.h|   16 +-
  include/configs/smdkv310.h |1 +
  include/configs/trats.h|8 +-
  include/configs/trats2.h   |4 +-
  25 files changed, 2918 insertions(+), 911 deletions(-)



Tested on Trats2.
Tested-by: Piotr Wilczek p.wilc...@samsung.com

Best regards,
Piotr Wilczek


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


Re: [U-Boot] Merge conflicts between ARM and mainline U-Boot trees

2014-04-08 Thread Piotr Wilczek

Hi Albert,



include/configs/trats2.h:
- commits 4d6c9671 (Piotr) and aafd2c5d (Przemyslaw)

include/configs/trats.h:
- commits fe601647 (Piotr) and 9960d9a8 (Lukasz)
- note: I manually removed CONFIG_EFI_PARTITION and
  CONFIG_PARTITION_UUIDS which are already defined in
  include/configs/exynos4-dt.h

Thanks in advance!

Amicalement,



Acked-by: Piotr Wilczek p.wilc...@samsung.com
Tested-by: Piotr Wilczek p.wilc...@samsung.com

Tested on Trats2.

Best regards,
Piotr Wilczek


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


Re: [U-Boot] [PATCH v2 2/4] arm: exynos: pinmux: Add sdmmc4 gpio configuration

2014-03-17 Thread Piotr Wilczek

Dear Beomho Seo,

On 03/14/2014 09:33 AM, Beomho Seo wrote:

For use dwmmc controller at exynos4, add SDMMC gpio configuration.
In case SDMMC2, do not use 8bit mode at exynos4.

Signed-off-by: Beomho Seo beomho@samsung.com
Signed-off-by: Jaehoon Chung jh80.ch...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Piotr Wilczek p.wilc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
- Fixed value initialise.
- Comment add in function.

  arch/arm/cpu/armv7/exynos/pinmux.c |   19 +++
  1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 9edb475..3dce5d2 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -632,16 +632,26 @@ static int exynos4_mmc_config(int peripheral, int flags)
struct exynos4_gpio_part2 *gpio2 =
(struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
struct s5p_gpio_bank *bank, *bank_ext;
+   unsigned int  func, func_ext;
int i;

switch (peripheral) {
case PERIPH_ID_SDMMC0:
bank = gpio2-k0;
bank_ext = gpio2-k1;
+   func = GPIO_FUNC(0x2);
+   func_ext = GPIO_FUNC(0x3);
break;
case PERIPH_ID_SDMMC2:
bank = gpio2-k2;
-   bank_ext = gpio2-k3;

that causes warning 'bank_ext' may be used uninitialized in this function


+   func = GPIO_FUNC(0x2);
+   func_ext = 0;
+   break;
+   case PERIPH_ID_SDMMC4:
+   bank = gpio2-k0;
+   bank_ext = gpio2-k1;
+   func = GPIO_FUNC(0x3);
+   func_ext = GPIO_FUNC(0x4);
break;
default:
return -1;
@@ -649,13 +659,14 @@ static int exynos4_mmc_config(int peripheral, int flags)
for (i = 0; i  7; i++) {
if (i == 2)
continue;
-   s5p_gpio_cfg_pin(bank, i,  GPIO_FUNC(0x2));
+   s5p_gpio_cfg_pin(bank, i,  func);
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
}
+   /* SDMMC do not use 8bit mode at exynos4 */
if (flags  PINMUX_FLAG_8BIT_MODE) {
for (i = 3; i  7; i++) {
-   s5p_gpio_cfg_pin(bank_ext, i,  GPIO_FUNC(0x3));
+   s5p_gpio_cfg_pin(bank_ext, i,  func_ext);
s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_NONE);
s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
}
@@ -722,10 +733,10 @@ static int exynos4_pinmux_config(int peripheral, int 
flags)
break;
case PERIPH_ID_SDMMC0:
case PERIPH_ID_SDMMC2:
+   case PERIPH_ID_SDMMC4:
return exynos4_mmc_config(peripheral, flags);
case PERIPH_ID_SDMMC1:
case PERIPH_ID_SDMMC3:
-   case PERIPH_ID_SDMMC4:
debug(SDMMC device %d not implemented\n, peripheral);
return -1;
default:



Best regards,
Piotr Wilczek

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


Re: [U-Boot] [PATCH v2 0/4] samsung: Add mmc controller to use dwmmc

2014-03-17 Thread Piotr Wilczek

On 03/14/2014 09:33 AM, Beomho Seo wrote:

This patch set for use dw mmc controller.
Patch enable supporting device tree for dw mmc controller.
For use dwmmc controller on trats2 board, enable configuration
dw_mmc, exynos_dwmmc, bounce_buffer and then disable sdhci configuration.
This patch set tested on TRATS2 board.

Changes for v2:
- Use device tree for dw mmc controller.
- dw mmc node is added device node on exynos4 device tree.
- dw mmc controller driver is fixed for use exynos4 and 5.
- add fdt compat id of exynos4 dwmmc.
- Add comment.

Beomho Seo (4):
   drivers: mmc: dwmmc: enable support for DT
   arm: exynos: pinmux: Add sdmmc4 gpio configuration
   arm: exynos: clock: Remove exynos4x12_set_mmc_clk function
   board: trats2: Enable device tree on Trats2


I tested this series on Trats2.
Tested-by: Piotr Wilczek p.wilc...@samsung.com


  arch/arm/cpu/armv7/exynos/clock.c  |   29 +
  arch/arm/cpu/armv7/exynos/pinmux.c |   19 +++
  arch/arm/dts/exynos4.dtsi  |8 
  arch/arm/dts/exynos4412-trats2.dts |8 
  drivers/mmc/exynos_dw_mmc.c|   20 
  include/fdtdec.h   |1 +
  lib/fdtdec.c   |1 +
  7 files changed, 50 insertions(+), 36 deletions(-)



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


[U-Boot] [PATCH V5 00/12] Exynos4: add support for device tree

2014-03-07 Thread Piotr Wilczek
This patch set enables support for device tree on all Exynos4 based boards.

DT support is enabled on Exynos mipi dsim and sdhci drives.
Common board.c file is reused for all functions common for
Exynos4 boards. Board specific files are implemented in the board files.
Origen, Universal, Trats and Trats2 boards are modifed to support device tree.

This patch series depends on:
[U-Boot] sizes.h - consolidate for all architectures
http://patchwork.ozlabs.org/patch/324427/

Changes for v5:
 - add exynos_mipi_dsi.txt file with documented bindings
 - changed the name of exynos_lcd_panel_init to exynos_lcd_misc_init
 - removed unused panel_info.resolution binding

Changes for v4:
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board
 - use - hypen in DT bindings
 - remove duplicated DT properties at exynos_fb.c file

Changes for v3:
 - moved max77686 init function to smdk5250 board file
 - board DTS files moved to arch/arm/dts
 - rebased on the latest tree

Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id
 - removed unnecesary white space
 - removed panel specific init function 's6e8ax0_init' to the board file
 - removed duplicate DTB node parsing for panel_info.logo_on
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file
 - fixed checking for SDMMC boundary
 - fiex debug message
 - fixed comment to 'pwr_gpio' struct filed
 - new patch to move checkboard to common file
 - reuse existing common board.c file
 - new patch that removes unused max77686_init function
 - fixed mmc2 addres in DT on Trats2

Piotr Wilczek (12):
  exynos4:pinmux:fdt: decode peripheral id
  video:mipidsim:fdt: Add DT support for mipi dsim driver
  video:exynos_fb:fdt: add additional fdt data
  drivers:mmc:sdhci: enable support for DT
  board:samsung: move checkboard to common file
  arm:exynos: add common DTS file for exynos 4
  board:samsung:common: move max77686 init function
  arm:exynos: enable sdhci and misc_init to common board
  board:origen: Enable device tree on Origen
  board:universal: Enable device tree on Universal
  board:trats: Enable device tree on Trats
  board:trats2: Enable device tree on Trats2

 arch/arm/cpu/armv7/exynos/pinmux.c |  17 +
 arch/arm/dts/Makefile  |   5 +
 arch/arm/dts/exynos4.dtsi  | 138 +++
 arch/arm/dts/exynos4210-origen.dts |  45 +++
 arch/arm/dts/exynos4210-trats.dts  | 120 ++
 arch/arm/dts/exynos4210-universal_c210.dts |  83 
 arch/arm/dts/exynos4412-trats2.dts | 434 +
 arch/arm/include/asm/arch-exynos/board.h   |  12 +
 arch/arm/include/asm/arch-exynos/mipi_dsim.h   |   5 +
 arch/arm/include/asm/arch-exynos/mmc.h |   7 +
 board/samsung/common/board.c   | 180 +++--
 board/samsung/origen/origen.c  | 112 +-
 board/samsung/smdk5250/exynos5-dt.c|  15 -
 board/samsung/smdk5250/smdk5250.c  | 125 ++
 board/samsung/smdk5420/smdk5420.c  |  15 -
 board/samsung/trats/trats.c| 213 +-
 board/samsung/trats2/trats2.c  | 233 +--
 board/samsung/universal_c210/universal.c   | 204 +++---
 doc/device-tree-bindings/video/exynos_mipi_dsi.txt |  82 
 drivers/mmc/s5p_sdhci.c| 129 ++
 drivers/video/exynos_fb.c  |  12 +
 drivers/video/exynos_mipi_dsi.c|  96 +
 include/configs/exynos4-dt.h   | 138 +++
 include/configs/origen.h   | 110 ++
 include/configs/s5pc210_universal.h| 152 +++-
 include/configs/trats.h| 206 +++---
 include/configs/trats2.h   | 204 ++
 include/fdtdec.h   |   2 +
 include/sdhci.h|   5 +
 lib/fdtdec.c   |   2 +
 30 files changed, 1765 insertions(+), 1336 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 arch/arm/dts/exynos4210-origen.dts
 create mode 100644 arch/arm/dts/exynos4210-trats.dts
 create mode 100644 arch/arm/dts/exynos4210-universal_c210.dts
 create mode 100644 arch/arm/dts/exynos4412-trats2.dts
 create mode 100644 doc/device-tree-bindings/video/exynos_mipi_dsi.txt
 create mode 100644 include/configs/exynos4-dt.h

-- 
1.8.3.2

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


[U-Boot] [PATCH V5 01/12] exynos4:pinmux:fdt: decode peripheral id

2014-03-07 Thread Piotr Wilczek
This patch adds api to decode peripheral id based on interrupt number.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - none

Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id
 - removed unnecesary white space

 arch/arm/cpu/armv7/exynos/pinmux.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 645c497..8d6e5c1 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -741,6 +741,21 @@ int exynos_pinmux_config(int peripheral, int flags)
 }
 
 #ifdef CONFIG_OF_CONTROL
+static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
+{
+   int err;
+   u32 cell[3];
+
+   err = fdtdec_get_int_array(blob, node, interrupts, cell,
+   ARRAY_SIZE(cell));
+   if (err) {
+   debug( invalid peripheral id\n);
+   return PERIPH_ID_NONE;
+   }
+
+   return cell[1];
+}
+
 static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 {
int err;
@@ -758,6 +773,8 @@ int pinmux_decode_periph_id(const void *blob, int node)
 {
if (cpu_is_exynos5())
return  exynos5_pinmux_decode_periph_id(blob, node);
+   else if (cpu_is_exynos4())
+   return  exynos4_pinmux_decode_periph_id(blob, node);
else
return PERIPH_ID_NONE;
 }
-- 
1.8.3.2

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


[U-Boot] [PATCH V5 03/12] video:exynos_fb:fdt: add additional fdt data

2014-03-07 Thread Piotr Wilczek
This patch adds the new exynos_lcd_misc_init() function for optional
lcd specific initialisation.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - changed the name of exynos_lcd_panel_init to exynos_lcd_misc_init
 - removed unused panel_info.resolution binding

Changes for v4:
 - remove duplicated DT properties at exynos_fb.c file

Changes for v3:
 - none

Changes for v2:
 - removed duplicate DTB node parsing for panel_info.logo_on
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file

 drivers/video/exynos_fb.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 00a0a11..e1e0d80 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
 void exynos_backlight_reset(void)
__attribute__((weak, alias(__exynos_backlight_reset)));
 
+int __exynos_lcd_misc_init(vidinfo_t *vid)
+{
+   return 0;
+}
+int exynos_lcd_misc_init(vidinfo_t *vid)
+   __attribute__((weak, alias(__exynos_lcd_misc_init)));
+
 static void lcd_panel_on(vidinfo_t *vid)
 {
udelay(vid-init_delay);
@@ -281,10 +288,15 @@ void lcd_ctrl_init(void *lcdbase)
 #ifdef CONFIG_OF_CONTROL
if (exynos_fimd_parse_dt(gd-fdt_blob))
debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
+   exynos_lcd_misc_init(panel_info);
 #else
/* initialize parameters which is specific to panel. */
init_panel_info(panel_info);
 #endif
+
panel_width = panel_info.vl_width;
panel_height = panel_info.vl_height;
 
-- 
1.8.3.2

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


[U-Boot] [PATCH V5 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-03-07 Thread Piotr Wilczek
This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - add exynos_mipi_dsi.txt file with documented bindings

Changes for v4:
 - use - hypen for DT bindings

Changes for v3:
 - none

Changes for v2:
 - removed panel specific init function 's6e8ax0_init' to the board file

 arch/arm/include/asm/arch-exynos/mipi_dsim.h   |  5 ++
 doc/device-tree-bindings/video/exynos_mipi_dsi.txt | 82 ++
 drivers/video/exynos_mipi_dsi.c| 96 ++
 include/fdtdec.h   |  1 +
 lib/fdtdec.c   |  1 +
 5 files changed, 185 insertions(+)
 create mode 100644 doc/device-tree-bindings/video/exynos_mipi_dsi.txt

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..50e5c25 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@
 
 #include linux/list.h
 #include linux/fb.h
+#include lcd.h
 
 #define PANEL_NAME_SIZE(32)
 
@@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct 
mipi_dsim_lcd_device
*lcd_dev);
 
 void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
 /* panel driver init based on mipi dsi interface */
 void s6e8ax0_init(void);
 
+#ifdef CONFIG_OF_CONTROL
+extern int mipi_power(void);
+#endif
 #endif /* _DSIM_H */
diff --git a/doc/device-tree-bindings/video/exynos_mipi_dsi.txt 
b/doc/device-tree-bindings/video/exynos_mipi_dsi.txt
new file mode 100644
index 000..4938ea0
--- /dev/null
+++ b/doc/device-tree-bindings/video/exynos_mipi_dsi.txt
@@ -0,0 +1,82 @@
+Exynos MIPI-DSIM Controller
+=
+
+Required properties:
+SOC specific:
+   compatible: should be samsung,exynos-mipi-dsi
+   reg: Base address of MIPI-DSIM IP.
+
+Board specific:
+   samsung,dsim-config-e-interface: interface to be used (RGB interface
+   for main display or CPU interface for main or sub display).
+   samsung,dsim-config-e-virtual-ch: virtual channel number that main
+   or sub display uses.
+   samsung,dsim-config-e-pixel-format: pixel stream format for main
+   or sub display.
+   samsung,dsim-config-e-burst-mode: selects Burst mode in Video mode.
+   in Non-burst mode, RGB data area is filled with RGB data and
+   NULL packets, according to input bandwidth of RGB interface.
+   samsung,dsim-config-e-no-data-lane: data lane count used by Master.
+   samsung,dsim-config-e-byte-clk: select byte clock source.
+   It must be DSIM_PLL_OUT_DIV8.
+   DSIM_EXT_CLK_DIV8 and DSIM_EXT_CLK_BYPASSS are not supported.
+   samsung,dsim-config-hfp: HFP disable mode.
+   If set, DSI master ignores HFP area in VIDEO mode.
+   In command mode, this variable is ignored.
+   samsung,dsim-config-p: P value for PMS setting.
+   samsung,dsim-config-m: M value for PMS setting.
+   samsung,dsim-config-s: S value for PMS setting.
+   samsung,dsim-config-pll-stable-time: the PLL Timer for stability
+   of the ganerated clock.
+   samsung,dsim-config-esc-clk: escape clock frequency for getting
+   the escape clock prescaler value.
+   samsung,dsim-config-stop-holding-cnt: the interval value between
+   transmitting read packet (or write set_tear_on command)
+   and BTA request. After transmitting read packet or write
+   set_tear_on command, BTA requests to D-PHY automatically.
+   This counter value specifies the interval between them.
+   samsung,dsim-config-bta-timeout: the timer for BTA. This register
+   specifies time out from BTA request to change the direction
+   with respect to Tx escape clock.
+   samsung,dsim-config-rx-timeout: the timer for LP Rx mode timeout.
+   this register specifies time out on how long RxValid deasserts,
+   after RxLpdt asserts with respect to Tx escape clock.
+   - RxValid specifies Rx data valid indicator.
+   - RxLpdt specifies an indicator that D-PHY is under RxLpdt mode
+   - RxValid and RxLpdt specifies signal from D-PHY.
+   samsung,dsim-device-name: name of the device.
+   samsung,dsim-device-id: unique device id.
+   samsung,dsim-device-bus_id: bus id for identifing connected bus
+   and this bus id should be same as id of mipi_dsim_device.
+
+Optional properties:
+   samsung,dsim-device-reverse-panel: reverse panel.
+
+Example

[U-Boot] [PATCH V5 04/12] drivers:mmc:sdhci: enable support for DT

2014-03-07 Thread Piotr Wilczek
This patch enables support for device tree for sdhci driver.
Non DT case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - none

Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - fixed checking for SDMMC boundary
 - fiex debug message
 - fixed comment to 'pwr_gpio' struct filed

 arch/arm/include/asm/arch-exynos/mmc.h |   7 ++
 drivers/mmc/s5p_sdhci.c| 129 +
 include/fdtdec.h   |   1 +
 include/sdhci.h|   5 ++
 lib/fdtdec.c   |   1 +
 5 files changed, 143 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mmc.h 
b/arch/arm/include/asm/arch-exynos/mmc.h
index 98d6530..0fb6461 100644
--- a/arch/arm/include/asm/arch-exynos/mmc.h
+++ b/arch/arm/include/asm/arch-exynos/mmc.h
@@ -53,6 +53,8 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x)  16)
 #define SDHCI_CTRL4_DRIVE_SHIFT(16)
 
+#define SDHCI_MAX_HOSTS 4
+
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
 static inline int s5p_mmc_init(int index, int bus_width)
@@ -62,4 +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
 
return s5p_sdhci_init(base, index, bus_width);
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_mmc_init(const void *blob);
+#endif
+
 #endif
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 40ff873..ccae4cc 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -8,8 +8,15 @@
 #include common.h
 #include malloc.h
 #include sdhci.h
+#include fdtdec.h
+#include libfdt.h
+#include asm/gpio.h
 #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)
@@ -86,3 +93,125 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 
return add_sdhci(host, 5200, 40);
 }
+
+#ifdef CONFIG_OF_CONTROL
+struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
+
+static int do_sdhci_init(struct sdhci_host *host)
+{
+   int dev_id, flag;
+   int err = 0;
+
+   flag = host-bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
+   dev_id = host-index + PERIPH_ID_SDMMC0;
+
+   if (fdt_gpio_isvalid(host-pwr_gpio)) {
+   gpio_direction_output(host-pwr_gpio.gpio, 1);
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   debug(MMC not configured\n);
+   return err;
+   }
+   }
+
+   if (fdt_gpio_isvalid(host-cd_gpio)) {
+   gpio_direction_output(host-cd_gpio.gpio, 0xf);
+   if (gpio_get_value(host-cd_gpio.gpio))
+   return -ENODEV;
+
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   printf(external SD not configured\n);
+   return err;
+   }
+   }
+
+   host-name = S5P_NAME;
+
+   host-quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
+   SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
+   SDHCI_QUIRK_WAIT_SEND_CMD;
+   host-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
+
+   host-set_control_reg = s5p_sdhci_set_control_reg;
+   host-set_clock = set_mmc_clk;
+
+   host-host_caps = MMC_MODE_HC;
+
+   return add_sdhci(host, 5200, 40);
+}
+
+static int sdhci_get_config(const void *blob, int node, struct sdhci_host 
*host)
+{
+   int bus_width, dev_id;
+   unsigned int base;
+
+   /* Get device id */
+   dev_id = pinmux_decode_periph_id(blob, node);
+   if (dev_id  PERIPH_ID_SDMMC0  dev_id  PERIPH_ID_SDMMC3) {
+   debug(MMC: Can't get device id\n);
+   return -1;
+   }
+   host-index = dev_id - PERIPH_ID_SDMMC0;
+
+   /* Get bus width */
+   bus_width = fdtdec_get_int(blob, node, samsung,bus-width, 0);
+   if (bus_width = 0) {
+   debug(MMC: Can't get bus-width\n);
+   return -1;
+   }
+   host-bus_width = bus_width;
+
+   /* Get the base address from the device node */
+   base = fdtdec_get_addr(blob, node, reg);
+   if (!base) {
+   debug(MMC: Can't get base address\n);
+   return -1;
+   }
+   host-ioaddr = (void *)base;
+
+   fdtdec_decode_gpio(blob, node, pwr-gpios, host-pwr_gpio);
+   fdtdec_decode_gpio(blob, node, cd-gpios, host-cd_gpio);
+
+   return 0;
+}
+
+static int process_nodes(const void *blob, int node_list[], int count)
+{
+   struct sdhci_host *host;
+   int i, node;
+
+   debug(%s: count = %d\n, __func__, count);
+
+   /* build

[U-Boot] [PATCH V5 05/12] board:samsung: move checkboard to common file

2014-03-07 Thread Piotr Wilczek
The checkboard function's implementation is common for all
DT supporting boards and should be placed in the board common file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Amar amarendra...@samsung.com

Acked-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
Changes for v5:
 - none

Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - new patch

 board/samsung/common/board.c| 12 
 board/samsung/smdk5250/exynos5-dt.c | 15 ---
 board/samsung/smdk5420/smdk5420.c   | 15 ---
 3 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cd873bc..f8562b2 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -377,7 +377,19 @@ int board_mmc_init(bd_t *bis)
return ret;
 }
 #endif
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+   const char *board_name;
+
+   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
+   printf(Board: %s\n, board_name ? board_name : unknown);
+
+   return 0;
+}
 #endif
+#endif /* CONFIG_OF_CONTROL */
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index 5fb8664..b22fba5 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -45,21 +45,6 @@ int exynos_init(void)
return 0;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_LCD
 void exynos_cfg_lcd_gpio(void)
 {
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 3ad2ad0..e4606ec 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -142,18 +142,3 @@ int board_get_revision(void)
 {
return 0;
 }
-
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH V5 06/12] arm:exynos: add common DTS file for exynos 4

2014-03-07 Thread Piotr Wilczek
This patch adds common dtsi file and config header for all
Exynos 4 based boards.

Patch additionaly adds board specific (weak) functions for
board_early_init_f and board_power_init functions.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - none

Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - reuse existing common board.c file

 arch/arm/dts/exynos4.dtsi| 138 +++
 arch/arm/include/asm/arch-exynos/board.h |  12 +++
 board/samsung/common/board.c |  18 +++-
 include/configs/exynos4-dt.h | 138 +++
 4 files changed, 304 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 include/configs/exynos4-dt.h

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
new file mode 100644
index 000..71dc7eb
--- /dev/null
+++ b/arch/arm/dts/exynos4.dtsi
@@ -0,0 +1,138 @@
+/*
+ * Samsung's Exynos4 SoC common device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/include/ skeleton.dtsi
+
+/ {
+   serial@1380 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1380 0x3c;
+   id = 0;
+   };
+
+   serial@1381 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1381 0x3c;
+   id = 1;
+   };
+
+   serial@1382 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1382 0x3c;
+   id = 2;
+   };
+
+   serial@1383 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1383 0x3c;
+   id = 3;
+   };
+
+   serial@1384 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1384 0x3c;
+   id = 4;
+   };
+
+   i2c@1386 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 0 0 0;
+   };
+
+   i2c@1387 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 1 1 0;
+   };
+
+   i2c@1388 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 2 2 0;
+   };
+
+   i2c@1389 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 3 3 0;
+   };
+
+   i2c@138a {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 4 4 0;
+   };
+
+   i2c@138b {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 5 5 0;
+   };
+
+   i2c@138c {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 6 6 0;
+   };
+
+   i2c@138d {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 7 7 0;
+   };
+
+   sdhci@1251 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1251 0x1000;
+   interrupts = 0 75 0;
+   };
+
+   sdhci@1252 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1252 0x1000;
+   interrupts = 0 76 0;
+   };
+
+   sdhci@1253 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1253 0x1000;
+   interrupts = 0 77 0;
+   };
+
+   sdhci@1254 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1254 0x1000;
+   interrupts = 0 78 0;
+   };
+
+   gpio: gpio {
+   gpio-controller;
+   #gpio-cells = 2;
+
+   interrupt-controller;
+   #interrupt-cells = 2;
+   };
+};
diff --git a/arch/arm/include/asm/arch-exynos/board.h 
b/arch/arm/include/asm/arch-exynos/board.h
index 243fb12..1b1cd0d 100644
--- a/arch/arm/include/asm/arch-exynos/board.h
+++ b/arch/arm/include/asm/arch-exynos/board.h
@@ -14,4 +14,16 @@
  */
 int exynos_init(void

[U-Boot] [PATCH V5 08/12] arm:exynos: enable sdhci and misc_init to common board

2014-03-07 Thread Piotr Wilczek
This patch enables sdhci initialisation and misc_init_r in common board
file for all exynos 4 based boards.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - none

Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - new patch

 board/samsung/common/board.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index a74b044..e95e9c4 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,6 +22,8 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
+#include lcd.h
+#include samsung/misc.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -183,6 +185,7 @@ int power_init_board(void)
 #endif
 
 #ifdef CONFIG_OF_CONTROL
+#ifdef CONFIG_SMC911X
 static int decode_sromc(const void *blob, struct fdt_sromc *config)
 {
int err;
@@ -206,6 +209,7 @@ static int decode_sromc(const void *blob, struct fdt_sromc 
*config)
}
return 0;
 }
+#endif
 
 int board_eth_init(bd_t *bis)
 {
@@ -263,10 +267,18 @@ int board_mmc_init(bd_t *bis)
 {
int ret;
 
+#ifdef CONFIG_SDHCI
+   /* mmc initializattion for available channels */
+   ret = exynos_mmc_init(gd-fdt_blob);
+   if (ret)
+   debug(mmc init failed\n);
+#endif
+#ifdef CONFIG_DWMMC
/* dwmmc initializattion for available channels */
ret = exynos_dwmmc_init(gd-fdt_blob);
if (ret)
debug(dwmmc init failed\n);
+#endif
 
return ret;
 }
@@ -315,3 +327,21 @@ int arch_early_init_r(void)
 
return 0;
 }
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
+#ifdef CONFIG_LCD_MENU
+   keys_init();
+   check_boot_mode();
+#endif
+#ifdef CONFIG_CMD_BMP
+   if (panel_info.logo_on)
+   draw_logo();
+#endif
+   return 0;
+}
+#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH V5 07/12] board:samsung:common: move max77686 init function

2014-03-07 Thread Piotr Wilczek
This patch moves board specific max77686 init function from
common board to smdk5250 board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Rajeshwari Birje rajeshwari.bi...@gmail.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - none

Changes for v4:
 - none

Changes for v3:
 - max77686 init function is moved to smdk5250 board file

Changes for v2:
 - new patch

 board/samsung/common/board.c  | 120 
 board/samsung/smdk5250/smdk5250.c | 125 ++
 2 files changed, 125 insertions(+), 120 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cf78d36..a74b044 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,7 +22,6 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
-#include power/max77686_pmic.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -175,129 +174,10 @@ static int board_init_cros_ec_devices(const void *blob)
 #endif
 
 #if defined(CONFIG_POWER)
-#ifdef CONFIG_POWER_MAX77686
-static int pmic_reg_update(struct pmic *p, int reg, uint regval)
-{
-   u32 val;
-   int ret = 0;
-
-   ret = pmic_reg_read(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register read failed\n, __func__, reg);
-   return -1;
-   }
-   val |= regval;
-   ret = pmic_reg_write(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register write failed\n, __func__, reg);
-   return -1;
-   }
-   return 0;
-}
-
-static int max77686_init(void)
-{
-   struct pmic *p;
-
-   if (pmic_init(I2C_PMIC))
-   return -1;
-
-   p = pmic_get(MAX77686_PMIC);
-   if (!p)
-   return -ENODEV;
-
-   if (pmic_probe(p))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ, MAX77686_32KHCP_EN))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT,
-   MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V))
-   return -1;
-
-   /* VDD_MIF */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT,
-  MAX77686_BUCK1OUT_1V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK1OUT);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL,
-   MAX77686_BUCK1CTRL_EN))
-   return -1;
-
-   /* VDD_ARM */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1,
-  MAX77686_BUCK2DVS1_1_3V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK2DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1,
-   MAX77686_BUCK2CTRL_ON))
-   return -1;
-
-   /* VDD_INT */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1,
-  MAX77686_BUCK3DVS1_1_0125V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK3DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_G3D */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1,
-  MAX77686_BUCK4DVS1_1_2V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK4DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK4CTRL1,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_LDO2 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO2CTRL1,
-   MAX77686_LD02CTRL1_1_5V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO3 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO3CTRL1,
-   MAX77686_LD03CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO5 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO5CTRL1,
-   MAX77686_LD05CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO10 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO10CTRL1,
-   MAX77686_LD10CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   return 0;
-}
-#endif
-
 int power_init_board(void)
 {
-   int ret = 0;
-
set_ps_hold_ctrl();
 
-#ifdef CONFIG_POWER_MAX77686
-   ret = max77686_init();
-#endif
-
return exynos_power_init();
 }
 #endif
diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index a69f73d

[U-Boot] [PATCH V5 09/12] board:origen: Enable device tree on Origen

2014-03-07 Thread Piotr Wilczek
This patch enables to run Origen board on device tree.

Uart, DRAM and MMC init functions are removed as their
generic replacements form the common board file are used.

The config file is modified to contain only board specific options.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - no changes

Changes for v4:
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile  |   2 +
 arch/arm/dts/exynos4210-origen.dts |  45 +++
 board/samsung/origen/origen.c  | 112 +++--
 include/configs/origen.h   | 110 ++--
 4 files changed, 87 insertions(+), 182 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-origen.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index e2fcca5..dad03cf 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,3 +1,5 @@
+dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb
+
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
exynos5250-smdk5250.dtb \
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
new file mode 100644
index 000..5c9d2ae
--- /dev/null
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -0,0 +1,45 @@
+/*
+ * Samsung's Exynos4210 based Origen board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ skeleton.dtsi
+/include/ exynos4.dtsi
+
+/ {
+   model = Insignal Origen evaluation board based on Exynos4210;
+   compatible = insignal,origen, samsung,exynos4210;
+
+   chosen {
+   bootargs =;
+   };
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   status = disabled;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 15f77ca..d502f02 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -11,129 +11,35 @@
 #include asm/arch/mmc.h
 #include asm/arch/periph.h
 #include asm/arch/pinmux.h
+#include usb.h
 
 DECLARE_GLOBAL_DATA_PTR;
-struct exynos4_gpio_part1 *gpio1;
-struct exynos4_gpio_part2 *gpio2;
 
-int board_init(void)
+u32 get_board_rev(void)
 {
-   gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
-   gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
-
-   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
return 0;
 }
 
-static int board_uart_init(void)
+int exynos_init(void)
 {
-   int err;
-
-   err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART0 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART1 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART2 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART3 not configured\n);
-   return err;
-   }
-
return 0;
 }
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
-{
-   int err;
-   err = board_uart_init();
-   if (err) {
-   debug(UART init failed\n);
-   return err;
-   }
-   return err;
-}
-#endif
-
-int dram_init(void)
+int board_usb_init(int index, enum usb_init_type init)
 {
-   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
-
return 0;
 }
 
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \
-   PHYS_SDRAM_1_SIZE);
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2

[U-Boot] [PATCH V5 11/12] board:trats: Enable device tree on Trats

2014-03-07 Thread Piotr Wilczek
This patch enables to run Trats board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
CC: Lukasz Majewski l.majew...@samsung.com
---
Changes for v5:
 - changed the name of exynos_lcd_panel_init to exynos_lcd_misc_init

Changes for v4:
 - use - hypen in DT bindings
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/exynos4210-trats.dts | 120 +
 board/samsung/trats/trats.c   | 213 ++
 include/configs/trats.h   | 206 ++--
 4 files changed, 185 insertions(+), 357 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-trats.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 488aec2..a853ec6 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
-   exynos4210-universal_c210.dtb
+   exynos4210-universal_c210.dtb \
+   exynos4210-trats.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4210-trats.dts 
b/arch/arm/dts/exynos4210-trats.dts
new file mode 100644
index 000..992e023
--- /dev/null
+++ b/arch/arm/dts/exynos4210-trats.dts
@@ -0,0 +1,120 @@
+/*
+ * Samsung's Exynos4210 based Trats board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats based on Exynos4210;
+   compatible = samsung,trats, samsung,exynos4210;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 720;
+   samsung,vl-row = 1280;
+   samsung,vl-width = 720;
+   samsung,vl-height = 1280;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 5;
+   samsung,vl-hbpd = 10;
+   samsung,vl-hfpd = 10;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 1;
+   samsung,vl-vfpd = 13;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,winid = 3;
+   samsung,power-on-delay = 30;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 1;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+
+   mipidsi@11c8 {
+   compatible = samsung,exynos-mipi-dsi;
+   reg = 0x11c8 0x5c;
+
+   samsung,dsim-config-e-interface = 1;
+   samsung,dsim-config-e-virtual-ch = 0;
+   samsung,dsim-config-e-pixel-format = 7;
+   samsung,dsim-config-e-burst-mode = 1;
+   samsung,dsim-config-e-no-data-lane = 3;
+   samsung,dsim-config-e-byte-clk = 0;
+   samsung,dsim-config-hfp = 1;
+
+   samsung,dsim-config-p = 3;
+   samsung,dsim-config-m = 120;
+   samsung,dsim-config-s = 1;
+
+   samsung,dsim-config-pll-stable-time = 500;
+   samsung,dsim-config-esc-clk = 2000;
+   samsung,dsim-config-stop-holding-cnt = 0x7ff;
+   samsung,dsim-config-bta-timeout = 0xff;
+   samsung,dsim-config-rx-timeout = 0x;
+
+   samsung,dsim-device-id = 0x;
+   samsung,dsim-device-bus-id = 0;
+
+   samsung,dsim-device-reverse-panel = 1;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253

[U-Boot] [PATCH V5 10/12] board:universal: Enable device tree on Universal

2014-03-07 Thread Piotr Wilczek
This patch enables to run Universal board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

Acked-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes for v5:
 - changed the name of exynos_lcd_panel_init to exynos_lcd_misc_init

Changes for v4:
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos4210-universal_c210.dts |  83 
 board/samsung/universal_c210/universal.c   | 204 -
 include/configs/s5pc210_universal.h| 152 +++--
 4 files changed, 185 insertions(+), 257 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-universal_c210.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index dad03cf..488aec2 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,4 +1,5 @@
-dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb
+dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
+   exynos4210-universal_c210.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4210-universal_c210.dts 
b/arch/arm/dts/exynos4210-universal_c210.dts
new file mode 100644
index 000..1cdd981
--- /dev/null
+++ b/arch/arm/dts/exynos4210-universal_c210.dts
@@ -0,0 +1,83 @@
+/*
+ * Samsung's Exynos4210 based Universal C210 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Universal C210 based on Exynos4210 rev0;
+   compatible = samsung,universal_c210, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 480;
+   samsung,vl-row = 800;
+   samsung,vl-width = 480;
+   samsung,vl-height = 800;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 2;
+   samsung,vl-hbpd = 16;
+   samsung,vl-hfpd = 16;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 8;
+   samsung,vl-vfpd = 8;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,pclk_name = 1;
+   samsung,sclk_div = 1;
+
+   samsung,winid = 0;
+   samsung,power-on-delay = 1;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 0;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+};
diff --git a/board/samsung/universal_c210/universal.c 
b/board/samsung/universal_c210/universal.c
index 96da7e0..f9d71b6 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -13,16 +13,17 @@
 #include asm/gpio.h
 #include asm/arch/adc.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/watchdog.h
-#include libtizen.h
 #include ld9040.h
 #include power/pmic.h
+#include usb.h
 #include usb/s3c_udc.h
 #include asm/arch/cpu.h
 #include power/max8998_pmic.h
+#include libtizen.h
 #include samsung/misc.h
+#include usb_mass_storage.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,7 +43,7 @@ static int get_hwrev(void)
 
 static void init_pmic_lcd(void);
 
-int power_init_board(void)
+int exynos_power_init(void)
 {
int ret;
 
@@ -59,22 +60,6 @@ int power_init_board(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) +
-   get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
-
-   return 0;
-}
-
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start

[U-Boot] [PATCH V5 12/12] board:trats2: Enable device tree on Trats2

2014-03-07 Thread Piotr Wilczek
This patch enables to run Trats2 board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v5:
 - changed the name of exynos_lcd_panel_init to exynos_lcd_misc_init

Changes for v4:
 - use - hypen in DT bindings
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - fixed mmc2 address in DT

 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos4412-trats2.dts | 434 +
 board/samsung/trats2/trats2.c  | 233 +---
 include/configs/trats2.h   | 204 -
 4 files changed, 483 insertions(+), 391 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-trats2.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a853ec6..631a9be 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,6 +1,7 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
exynos4210-universal_c210.dtb \
-   exynos4210-trats.dtb
+   exynos4210-trats.dtb \
+   exynos4412-trats2.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4412-trats2.dts 
b/arch/arm/dts/exynos4412-trats2.dts
new file mode 100644
index 000..7d32067
--- /dev/null
+++ b/arch/arm/dts/exynos4412-trats2.dts
@@ -0,0 +1,434 @@
+/*
+ * Samsung's Exynos4412 based Trats2 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats2 based on Exynos4412;
+   compatible = samsung,trats2, samsung,exynos4412;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   i2c@138d {
+   samsung,i2c-sda-delay = 100;
+   samsung,i2c-slave-addr = 0x10;
+   samsung,i2c-max-bus-freq = 10;
+   status = okay;
+
+   max77686_pmic@09 {
+   compatible = maxim,max77686_pmic;
+   interrupts = 7 0;
+   reg = 0x09 0 0;
+   #clock-cells = 1;
+
+   voltage-regulators {
+   ldo1_reg: ldo1 {
+   regulator-compatible = LDO1;
+   regulator-name = VALIVE_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo2_reg: ldo2 {
+   regulator-compatible = LDO2;
+   regulator-name = VM1M2_1.2V_AP;
+   regulator-min-microvolt = 120;
+   regulator-max-microvolt = 120;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo3_reg: ldo3 {
+   regulator-compatible = LDO3;
+   regulator-name = VCC_1.8V_AP;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo4_reg: ldo4 {
+   regulator-compatible = LDO4;
+   regulator-name = VCC_2.8V_AP;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo5_reg: ldo5 {
+   regulator-compatible

[U-Boot] [PATCH V4 00/12] Exynos4: add support for device tree

2014-03-04 Thread Piotr Wilczek
This patch set enables support for device tree on all Exynos4 based boards.

DT support is enabled on Exynos mipi dsim and sdhci drives.
Common board.c file is reused for all functions common for
Exynos4 boards. Board specific files are implemented in the board files.
Origen, Universal, Trats and Trats2 boards are modifed to support device tree.

This patch series depends on:
[U-Boot] sizes.h - consolidate for all architectures
http://patchwork.ozlabs.org/patch/324427/

Changes for v4:
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board
 - use - hypen in DT bindings
 - remove duplicated DT properties at exynos_fb.c file

Changes for v3:
 - moved max77686 init function to smdk5250 board file
 - board DTS files moved to arch/arm/dts
 - rebased on the latest tree

Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id
 - removed unnecesary white space
 - removed panel specific init function 's6e8ax0_init' to the board file
 - removed duplicate DTB node parsing for panel_info.logo_on
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file
 - fixed checking for SDMMC boundary
 - fiex debug message
 - fixed comment to 'pwr_gpio' struct filed
 - new patch to move checkboard to common file
 - reuse existing common board.c file
 - new patch that removes unused max77686_init function
 - fixed mmc2 addres in DT on Trats2

Piotr Wilczek (12):
  exynos4:pinmux:fdt: decode peripheral id
  video:mipidsim:fdt: Add DT support for mipi dsim driver
  video:exynos_fb:fdt: add additional fdt data
  drivers:mmc:sdhci: enable support for DT
  board:samsung: move checkboard to common file
  arm:exynos: add common DTS file for exynos 4
  board:samsung:common: move max77686 init function
  arm:exynos: enable sdhci and misc_init to common board
  board:origen: Enable device tree on Origen
  board:universal: Enable device tree on Universal
  board:trats: Enable device tree on Trats
  board:trats2: Enable device tree on Trats2

 arch/arm/cpu/armv7/exynos/pinmux.c   |  17 ++
 arch/arm/dts/Makefile|   5 +
 arch/arm/dts/exynos4.dtsi| 138 +
 arch/arm/dts/exynos4210-origen.dts   |  45 +++
 arch/arm/dts/exynos4210-trats.dts| 120 
 arch/arm/dts/exynos4210-universal_c210.dts   |  83 +
 arch/arm/dts/exynos4412-trats2.dts   | 434 +++
 arch/arm/include/asm/arch-exynos/board.h |  12 +
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |   5 +
 arch/arm/include/asm/arch-exynos/mmc.h   |   7 +
 board/samsung/common/board.c | 180 ---
 board/samsung/origen/origen.c| 112 +--
 board/samsung/smdk5250/exynos5-dt.c  |  15 -
 board/samsung/smdk5250/smdk5250.c| 125 
 board/samsung/smdk5420/smdk5420.c|  15 -
 board/samsung/trats/trats.c  | 213 +
 board/samsung/trats2/trats2.c| 233 +-
 board/samsung/universal_c210/universal.c | 204 -
 drivers/mmc/s5p_sdhci.c  | 129 
 drivers/video/exynos_fb.c|  15 +
 drivers/video/exynos_mipi_dsi.c  |  96 ++
 include/configs/exynos4-dt.h | 138 +
 include/configs/origen.h | 110 ++-
 include/configs/s5pc210_universal.h  | 152 +++---
 include/configs/trats.h  | 206 -
 include/configs/trats2.h | 204 +++--
 include/fdtdec.h |   2 +
 include/sdhci.h  |   5 +
 lib/fdtdec.c |   2 +
 29 files changed, 1686 insertions(+), 1336 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 arch/arm/dts/exynos4210-origen.dts
 create mode 100644 arch/arm/dts/exynos4210-trats.dts
 create mode 100644 arch/arm/dts/exynos4210-universal_c210.dts
 create mode 100644 arch/arm/dts/exynos4412-trats2.dts
 create mode 100644 include/configs/exynos4-dt.h

-- 
1.8.3.2

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


[U-Boot] [PATCH V4 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-03-04 Thread Piotr Wilczek
This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - use - hypen for DT bindings

Changes for v3:
 - none

Changes for v2:
 - removed panel specific init function 's6e8ax0_init' to the board file

 arch/arm/include/asm/arch-exynos/mipi_dsim.h |  5 ++
 drivers/video/exynos_mipi_dsi.c  | 96 
 include/fdtdec.h |  1 +
 lib/fdtdec.c |  1 +
 4 files changed, 103 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..50e5c25 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@
 
 #include linux/list.h
 #include linux/fb.h
+#include lcd.h
 
 #define PANEL_NAME_SIZE(32)
 
@@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct 
mipi_dsim_lcd_device
*lcd_dev);
 
 void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
 /* panel driver init based on mipi dsi interface */
 void s6e8ax0_init(void);
 
+#ifdef CONFIG_OF_CONTROL
+extern int mipi_power(void);
+#endif
 #endif /* _DSIM_H */
diff --git a/drivers/video/exynos_mipi_dsi.c b/drivers/video/exynos_mipi_dsi.c
index 8bb8fea..7dd4652 100644
--- a/drivers/video/exynos_mipi_dsi.c
+++ b/drivers/video/exynos_mipi_dsi.c
@@ -9,6 +9,8 @@
 
 #include common.h
 #include malloc.h
+#include fdtdec.h
+#include libfdt.h
 #include linux/err.h
 #include asm/arch/dsim.h
 #include asm/arch/mipi_dsim.h
@@ -22,7 +24,14 @@
 #define master_to_driver(a)(a-dsim_lcd_drv)
 #define master_to_device(a)(a-dsim_lcd_dev)
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static struct exynos_platform_mipi_dsim *dsim_pd;
+#ifdef CONFIG_OF_CONTROL
+static struct mipi_dsim_config dsim_config_dt;
+static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
+static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
+#endif
 
 struct mipi_dsim_ddi {
int bus_id;
@@ -238,3 +247,90 @@ void exynos_set_dsim_platform_data(struct 
exynos_platform_mipi_dsim *pd)
 
dsim_pd = pd;
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_dsim_config_parse_dt(const void *blob)
+{
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
+   if (node = 0) {
+   printf(exynos_mipi_dsi: Can't get device node for mipi dsi\n);
+   return -ENODEV;
+   }
+
+   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-interface, 0);
+
+   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-virtual-ch, 0);
+
+   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-pixel-format, 0);
+
+   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-burst-mode, 0);
+
+   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-no-data-lane, 0);
+
+   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-byte-clk, 0);
+
+   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
+   samsung,dsim-config-hfp, 0);
+
+   dsim_config_dt.p = fdtdec_get_int(blob, node,
+ samsung,dsim-config-p, 0);
+   dsim_config_dt.m = fdtdec_get_int(blob, node,
+ samsung,dsim-config-m, 0);
+   dsim_config_dt.s = fdtdec_get_int(blob, node,
+ samsung,dsim-config-s, 0);
+
+   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
+   samsung,dsim-config-pll-stable-time, 0);
+
+   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-esc-clk, 0);
+
+   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
+   samsung,dsim-config-stop-holding-cnt, 0);
+
+   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-bta-timeout, 0);
+
+   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-rx-timeout, 0);
+
+   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
+   samsung,dsim-device-name);
+
+   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node

[U-Boot] [PATCH V4 01/12] exynos4:pinmux:fdt: decode peripheral id

2014-03-04 Thread Piotr Wilczek
This patch adds api to decode peripheral id based on interrupt number.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id
 - removed unnecesary white space

 arch/arm/cpu/armv7/exynos/pinmux.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 645c497..8d6e5c1 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -741,6 +741,21 @@ int exynos_pinmux_config(int peripheral, int flags)
 }
 
 #ifdef CONFIG_OF_CONTROL
+static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
+{
+   int err;
+   u32 cell[3];
+
+   err = fdtdec_get_int_array(blob, node, interrupts, cell,
+   ARRAY_SIZE(cell));
+   if (err) {
+   debug( invalid peripheral id\n);
+   return PERIPH_ID_NONE;
+   }
+
+   return cell[1];
+}
+
 static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 {
int err;
@@ -758,6 +773,8 @@ int pinmux_decode_periph_id(const void *blob, int node)
 {
if (cpu_is_exynos5())
return  exynos5_pinmux_decode_periph_id(blob, node);
+   else if (cpu_is_exynos4())
+   return  exynos4_pinmux_decode_periph_id(blob, node);
else
return PERIPH_ID_NONE;
 }
-- 
1.8.3.2

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


[U-Boot] [PATCH V4 03/12] video:exynos_fb:fdt: add additional fdt data

2014-03-04 Thread Piotr Wilczek
This patch adds additional data parsing from DTB and adds the new
exynos_lcd_panel_init() function for panel specific initialisation
from the board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - remove duplicated DT properties at exynos_fb.c file

Changes for v3:
 - none

Changes for v2:
 - removed duplicate DTB node parsing for panel_info.logo_on
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file

 drivers/video/exynos_fb.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 00a0a11..77a3186 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
 void exynos_backlight_reset(void)
__attribute__((weak, alias(__exynos_backlight_reset)));
 
+int __exynos_lcd_panel_init(vidinfo_t *vid)
+{
+   return 0;
+}
+int exynos_lcd_panel_init(vidinfo_t *vid)
+   __attribute__((weak, alias(__exynos_lcd_panel_init)));
+
 static void lcd_panel_on(vidinfo_t *vid)
 {
udelay(vid-init_delay);
@@ -269,6 +276,9 @@ int exynos_fimd_parse_dt(const void *blob)
panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
samsung,dual-lcd-enabled, 0);
 
+   panel_info.resolution = fdtdec_get_int(blob, node,
+   samsung,resolution, 0);
+
return 0;
 }
 #endif
@@ -281,10 +291,15 @@ void lcd_ctrl_init(void *lcdbase)
 #ifdef CONFIG_OF_CONTROL
if (exynos_fimd_parse_dt(gd-fdt_blob))
debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
+   exynos_lcd_panel_init(panel_info);
 #else
/* initialize parameters which is specific to panel. */
init_panel_info(panel_info);
 #endif
+
panel_width = panel_info.vl_width;
panel_height = panel_info.vl_height;
 
-- 
1.8.3.2

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


[U-Boot] [PATCH V4 04/12] drivers:mmc:sdhci: enable support for DT

2014-03-04 Thread Piotr Wilczek
This patch enables support for device tree for sdhci driver.
Non DT case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - fixed checking for SDMMC boundary
 - fiex debug message
 - fixed comment to 'pwr_gpio' struct filed

 arch/arm/include/asm/arch-exynos/mmc.h |   7 ++
 drivers/mmc/s5p_sdhci.c| 129 +
 include/fdtdec.h   |   1 +
 include/sdhci.h|   5 ++
 lib/fdtdec.c   |   1 +
 5 files changed, 143 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mmc.h 
b/arch/arm/include/asm/arch-exynos/mmc.h
index 98d6530..0fb6461 100644
--- a/arch/arm/include/asm/arch-exynos/mmc.h
+++ b/arch/arm/include/asm/arch-exynos/mmc.h
@@ -53,6 +53,8 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x)  16)
 #define SDHCI_CTRL4_DRIVE_SHIFT(16)
 
+#define SDHCI_MAX_HOSTS 4
+
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
 static inline int s5p_mmc_init(int index, int bus_width)
@@ -62,4 +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
 
return s5p_sdhci_init(base, index, bus_width);
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_mmc_init(const void *blob);
+#endif
+
 #endif
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 40ff873..ccae4cc 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -8,8 +8,15 @@
 #include common.h
 #include malloc.h
 #include sdhci.h
+#include fdtdec.h
+#include libfdt.h
+#include asm/gpio.h
 #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)
@@ -86,3 +93,125 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 
return add_sdhci(host, 5200, 40);
 }
+
+#ifdef CONFIG_OF_CONTROL
+struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
+
+static int do_sdhci_init(struct sdhci_host *host)
+{
+   int dev_id, flag;
+   int err = 0;
+
+   flag = host-bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
+   dev_id = host-index + PERIPH_ID_SDMMC0;
+
+   if (fdt_gpio_isvalid(host-pwr_gpio)) {
+   gpio_direction_output(host-pwr_gpio.gpio, 1);
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   debug(MMC not configured\n);
+   return err;
+   }
+   }
+
+   if (fdt_gpio_isvalid(host-cd_gpio)) {
+   gpio_direction_output(host-cd_gpio.gpio, 0xf);
+   if (gpio_get_value(host-cd_gpio.gpio))
+   return -ENODEV;
+
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   printf(external SD not configured\n);
+   return err;
+   }
+   }
+
+   host-name = S5P_NAME;
+
+   host-quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
+   SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
+   SDHCI_QUIRK_WAIT_SEND_CMD;
+   host-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
+
+   host-set_control_reg = s5p_sdhci_set_control_reg;
+   host-set_clock = set_mmc_clk;
+
+   host-host_caps = MMC_MODE_HC;
+
+   return add_sdhci(host, 5200, 40);
+}
+
+static int sdhci_get_config(const void *blob, int node, struct sdhci_host 
*host)
+{
+   int bus_width, dev_id;
+   unsigned int base;
+
+   /* Get device id */
+   dev_id = pinmux_decode_periph_id(blob, node);
+   if (dev_id  PERIPH_ID_SDMMC0  dev_id  PERIPH_ID_SDMMC3) {
+   debug(MMC: Can't get device id\n);
+   return -1;
+   }
+   host-index = dev_id - PERIPH_ID_SDMMC0;
+
+   /* Get bus width */
+   bus_width = fdtdec_get_int(blob, node, samsung,bus-width, 0);
+   if (bus_width = 0) {
+   debug(MMC: Can't get bus-width\n);
+   return -1;
+   }
+   host-bus_width = bus_width;
+
+   /* Get the base address from the device node */
+   base = fdtdec_get_addr(blob, node, reg);
+   if (!base) {
+   debug(MMC: Can't get base address\n);
+   return -1;
+   }
+   host-ioaddr = (void *)base;
+
+   fdtdec_decode_gpio(blob, node, pwr-gpios, host-pwr_gpio);
+   fdtdec_decode_gpio(blob, node, cd-gpios, host-cd_gpio);
+
+   return 0;
+}
+
+static int process_nodes(const void *blob, int node_list[], int count)
+{
+   struct sdhci_host *host;
+   int i, node;
+
+   debug(%s: count = %d\n, __func__, count);
+
+   /* build sdhci_host[] for each

[U-Boot] [PATCH V4 05/12] board:samsung: move checkboard to common file

2014-03-04 Thread Piotr Wilczek
The checkboard function's implementation is common for all
DT supporting boards and should be placed in the board common file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Amar amarendra...@samsung.com

Acked-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - new patch

 board/samsung/common/board.c| 12 
 board/samsung/smdk5250/exynos5-dt.c | 15 ---
 board/samsung/smdk5420/smdk5420.c   | 15 ---
 3 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cd873bc..f8562b2 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -377,7 +377,19 @@ int board_mmc_init(bd_t *bis)
return ret;
 }
 #endif
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+   const char *board_name;
+
+   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
+   printf(Board: %s\n, board_name ? board_name : unknown);
+
+   return 0;
+}
 #endif
+#endif /* CONFIG_OF_CONTROL */
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index 5fb8664..b22fba5 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -45,21 +45,6 @@ int exynos_init(void)
return 0;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_LCD
 void exynos_cfg_lcd_gpio(void)
 {
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 3ad2ad0..e4606ec 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -142,18 +142,3 @@ int board_get_revision(void)
 {
return 0;
 }
-
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH V4 09/12] board:origen: Enable device tree on Origen

2014-03-04 Thread Piotr Wilczek
This patch enables to run Origen board on device tree.

Uart, DRAM and MMC init functions are removed as their
generic replacements form the common board file are used.

The config file is modified to contain only board specific options.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile  |   2 +
 arch/arm/dts/exynos4210-origen.dts |  45 +++
 board/samsung/origen/origen.c  | 112 +++--
 include/configs/origen.h   | 110 ++--
 4 files changed, 87 insertions(+), 182 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-origen.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2658911..7abca75 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,3 +1,5 @@
+dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb
+
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
exynos5250-smdk5250.dtb \
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
new file mode 100644
index 000..5c9d2ae
--- /dev/null
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -0,0 +1,45 @@
+/*
+ * Samsung's Exynos4210 based Origen board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ skeleton.dtsi
+/include/ exynos4.dtsi
+
+/ {
+   model = Insignal Origen evaluation board based on Exynos4210;
+   compatible = insignal,origen, samsung,exynos4210;
+
+   chosen {
+   bootargs =;
+   };
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   status = disabled;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 15f77ca..d502f02 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -11,129 +11,35 @@
 #include asm/arch/mmc.h
 #include asm/arch/periph.h
 #include asm/arch/pinmux.h
+#include usb.h
 
 DECLARE_GLOBAL_DATA_PTR;
-struct exynos4_gpio_part1 *gpio1;
-struct exynos4_gpio_part2 *gpio2;
 
-int board_init(void)
+u32 get_board_rev(void)
 {
-   gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
-   gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
-
-   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
return 0;
 }
 
-static int board_uart_init(void)
+int exynos_init(void)
 {
-   int err;
-
-   err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART0 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART1 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART2 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART3 not configured\n);
-   return err;
-   }
-
return 0;
 }
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
-{
-   int err;
-   err = board_uart_init();
-   if (err) {
-   debug(UART init failed\n);
-   return err;
-   }
-   return err;
-}
-#endif
-
-int dram_init(void)
+int board_usb_init(int index, enum usb_init_type init)
 {
-   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
-
return 0;
 }
 
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \
-   PHYS_SDRAM_1_SIZE);
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size

[U-Boot] [PATCH V4 08/12] arm:exynos: enable sdhci and misc_init to common board

2014-03-04 Thread Piotr Wilczek
This patch enables sdhci initialisation and misc_init_r in common board
file for all exynos 4 based boards.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - new patch

 board/samsung/common/board.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index a74b044..e95e9c4 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,6 +22,8 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
+#include lcd.h
+#include samsung/misc.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -183,6 +185,7 @@ int power_init_board(void)
 #endif
 
 #ifdef CONFIG_OF_CONTROL
+#ifdef CONFIG_SMC911X
 static int decode_sromc(const void *blob, struct fdt_sromc *config)
 {
int err;
@@ -206,6 +209,7 @@ static int decode_sromc(const void *blob, struct fdt_sromc 
*config)
}
return 0;
 }
+#endif
 
 int board_eth_init(bd_t *bis)
 {
@@ -263,10 +267,18 @@ int board_mmc_init(bd_t *bis)
 {
int ret;
 
+#ifdef CONFIG_SDHCI
+   /* mmc initializattion for available channels */
+   ret = exynos_mmc_init(gd-fdt_blob);
+   if (ret)
+   debug(mmc init failed\n);
+#endif
+#ifdef CONFIG_DWMMC
/* dwmmc initializattion for available channels */
ret = exynos_dwmmc_init(gd-fdt_blob);
if (ret)
debug(dwmmc init failed\n);
+#endif
 
return ret;
 }
@@ -315,3 +327,21 @@ int arch_early_init_r(void)
 
return 0;
 }
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
+#ifdef CONFIG_LCD_MENU
+   keys_init();
+   check_boot_mode();
+#endif
+#ifdef CONFIG_CMD_BMP
+   if (panel_info.logo_on)
+   draw_logo();
+#endif
+   return 0;
+}
+#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH V4 06/12] arm:exynos: add common DTS file for exynos 4

2014-03-04 Thread Piotr Wilczek
This patch adds common dtsi file and config header for all
Exynos 4 based boards.

Patch additionaly adds board specific (weak) functions for
board_early_init_f and board_power_init functions.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - none

Changes for v3:
 - none

Changes for v2:
 - reuse existing common board.c file

 arch/arm/dts/exynos4.dtsi| 138 +++
 arch/arm/include/asm/arch-exynos/board.h |  12 +++
 board/samsung/common/board.c |  18 +++-
 include/configs/exynos4-dt.h | 138 +++
 4 files changed, 304 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 include/configs/exynos4-dt.h

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
new file mode 100644
index 000..71dc7eb
--- /dev/null
+++ b/arch/arm/dts/exynos4.dtsi
@@ -0,0 +1,138 @@
+/*
+ * Samsung's Exynos4 SoC common device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/include/ skeleton.dtsi
+
+/ {
+   serial@1380 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1380 0x3c;
+   id = 0;
+   };
+
+   serial@1381 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1381 0x3c;
+   id = 1;
+   };
+
+   serial@1382 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1382 0x3c;
+   id = 2;
+   };
+
+   serial@1383 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1383 0x3c;
+   id = 3;
+   };
+
+   serial@1384 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1384 0x3c;
+   id = 4;
+   };
+
+   i2c@1386 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 0 0 0;
+   };
+
+   i2c@1387 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 1 1 0;
+   };
+
+   i2c@1388 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 2 2 0;
+   };
+
+   i2c@1389 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 3 3 0;
+   };
+
+   i2c@138a {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 4 4 0;
+   };
+
+   i2c@138b {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 5 5 0;
+   };
+
+   i2c@138c {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 6 6 0;
+   };
+
+   i2c@138d {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 7 7 0;
+   };
+
+   sdhci@1251 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1251 0x1000;
+   interrupts = 0 75 0;
+   };
+
+   sdhci@1252 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1252 0x1000;
+   interrupts = 0 76 0;
+   };
+
+   sdhci@1253 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1253 0x1000;
+   interrupts = 0 77 0;
+   };
+
+   sdhci@1254 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1254 0x1000;
+   interrupts = 0 78 0;
+   };
+
+   gpio: gpio {
+   gpio-controller;
+   #gpio-cells = 2;
+
+   interrupt-controller;
+   #interrupt-cells = 2;
+   };
+};
diff --git a/arch/arm/include/asm/arch-exynos/board.h 
b/arch/arm/include/asm/arch-exynos/board.h
index 243fb12..1b1cd0d 100644
--- a/arch/arm/include/asm/arch-exynos/board.h
+++ b/arch/arm/include/asm/arch-exynos/board.h
@@ -14,4 +14,16 @@
  */
 int exynos_init(void);
 
+/*
+ * Exynos board specific

[U-Boot] [PATCH V4 07/12] board:samsung:common: move max77686 init function

2014-03-04 Thread Piotr Wilczek
This patch moves board specific max77686 init function from
common board to smdk5250 board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Rajeshwari Birje rajeshwari.bi...@gmail.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - none

Changes for v3:
 - max77686 init function is moved to smdk5250 board file

Changes for v2:
 - new patch

 board/samsung/common/board.c  | 120 
 board/samsung/smdk5250/smdk5250.c | 125 ++
 2 files changed, 125 insertions(+), 120 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cf78d36..a74b044 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,7 +22,6 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
-#include power/max77686_pmic.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -175,129 +174,10 @@ static int board_init_cros_ec_devices(const void *blob)
 #endif
 
 #if defined(CONFIG_POWER)
-#ifdef CONFIG_POWER_MAX77686
-static int pmic_reg_update(struct pmic *p, int reg, uint regval)
-{
-   u32 val;
-   int ret = 0;
-
-   ret = pmic_reg_read(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register read failed\n, __func__, reg);
-   return -1;
-   }
-   val |= regval;
-   ret = pmic_reg_write(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register write failed\n, __func__, reg);
-   return -1;
-   }
-   return 0;
-}
-
-static int max77686_init(void)
-{
-   struct pmic *p;
-
-   if (pmic_init(I2C_PMIC))
-   return -1;
-
-   p = pmic_get(MAX77686_PMIC);
-   if (!p)
-   return -ENODEV;
-
-   if (pmic_probe(p))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ, MAX77686_32KHCP_EN))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT,
-   MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V))
-   return -1;
-
-   /* VDD_MIF */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT,
-  MAX77686_BUCK1OUT_1V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK1OUT);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL,
-   MAX77686_BUCK1CTRL_EN))
-   return -1;
-
-   /* VDD_ARM */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1,
-  MAX77686_BUCK2DVS1_1_3V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK2DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1,
-   MAX77686_BUCK2CTRL_ON))
-   return -1;
-
-   /* VDD_INT */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1,
-  MAX77686_BUCK3DVS1_1_0125V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK3DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_G3D */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1,
-  MAX77686_BUCK4DVS1_1_2V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK4DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK4CTRL1,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_LDO2 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO2CTRL1,
-   MAX77686_LD02CTRL1_1_5V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO3 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO3CTRL1,
-   MAX77686_LD03CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO5 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO5CTRL1,
-   MAX77686_LD05CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO10 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO10CTRL1,
-   MAX77686_LD10CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   return 0;
-}
-#endif
-
 int power_init_board(void)
 {
-   int ret = 0;
-
set_ps_hold_ctrl();
 
-#ifdef CONFIG_POWER_MAX77686
-   ret = max77686_init();
-#endif
-
return exynos_power_init();
 }
 #endif
diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index a69f73d..28a6d9e 100644
--- a/board

[U-Boot] [PATCH V4 10/12] board:universal: Enable device tree on Universal

2014-03-04 Thread Piotr Wilczek
This patch enables to run Universal board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

Acked-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes for v4:
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos4210-universal_c210.dts |  83 
 board/samsung/universal_c210/universal.c   | 204 -
 include/configs/s5pc210_universal.h| 152 +++--
 4 files changed, 185 insertions(+), 257 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-universal_c210.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 7abca75..d30954c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,4 +1,5 @@
-dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb
+dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
+   exynos4210-universal_c210.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4210-universal_c210.dts 
b/arch/arm/dts/exynos4210-universal_c210.dts
new file mode 100644
index 000..1cdd981
--- /dev/null
+++ b/arch/arm/dts/exynos4210-universal_c210.dts
@@ -0,0 +1,83 @@
+/*
+ * Samsung's Exynos4210 based Universal C210 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Universal C210 based on Exynos4210 rev0;
+   compatible = samsung,universal_c210, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 480;
+   samsung,vl-row = 800;
+   samsung,vl-width = 480;
+   samsung,vl-height = 800;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 2;
+   samsung,vl-hbpd = 16;
+   samsung,vl-hfpd = 16;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 8;
+   samsung,vl-vfpd = 8;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,pclk_name = 1;
+   samsung,sclk_div = 1;
+
+   samsung,winid = 0;
+   samsung,power-on-delay = 1;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 0;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+};
diff --git a/board/samsung/universal_c210/universal.c 
b/board/samsung/universal_c210/universal.c
index 96da7e0..82249d3 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -13,16 +13,17 @@
 #include asm/gpio.h
 #include asm/arch/adc.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/watchdog.h
-#include libtizen.h
 #include ld9040.h
 #include power/pmic.h
+#include usb.h
 #include usb/s3c_udc.h
 #include asm/arch/cpu.h
 #include power/max8998_pmic.h
+#include libtizen.h
 #include samsung/misc.h
+#include usb_mass_storage.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,7 +43,7 @@ static int get_hwrev(void)
 
 static void init_pmic_lcd(void);
 
-int power_init_board(void)
+int exynos_power_init(void)
 {
int ret;
 
@@ -59,22 +60,6 @@ int power_init_board(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) +
-   get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
-
-   return 0;
-}
-
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-   gd-bd-bi_dram[1

[U-Boot] [PATCH V4 11/12] board:trats: Enable device tree on Trats

2014-03-04 Thread Piotr Wilczek
This patch enables to run Trats board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
CC: Lukasz Majewski l.majew...@samsung.com
---
Changes for v4:
 - use - hypen in DT bindings
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/exynos4210-trats.dts | 120 +
 board/samsung/trats/trats.c   | 213 ++
 include/configs/trats.h   | 206 ++--
 4 files changed, 185 insertions(+), 357 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-trats.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d30954c..20c081e 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
-   exynos4210-universal_c210.dtb
+   exynos4210-universal_c210.dtb \
+   exynos4210-trats.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4210-trats.dts 
b/arch/arm/dts/exynos4210-trats.dts
new file mode 100644
index 000..992e023
--- /dev/null
+++ b/arch/arm/dts/exynos4210-trats.dts
@@ -0,0 +1,120 @@
+/*
+ * Samsung's Exynos4210 based Trats board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats based on Exynos4210;
+   compatible = samsung,trats, samsung,exynos4210;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 720;
+   samsung,vl-row = 1280;
+   samsung,vl-width = 720;
+   samsung,vl-height = 1280;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 5;
+   samsung,vl-hbpd = 10;
+   samsung,vl-hfpd = 10;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 1;
+   samsung,vl-vfpd = 13;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,winid = 3;
+   samsung,power-on-delay = 30;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 1;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+
+   mipidsi@11c8 {
+   compatible = samsung,exynos-mipi-dsi;
+   reg = 0x11c8 0x5c;
+
+   samsung,dsim-config-e-interface = 1;
+   samsung,dsim-config-e-virtual-ch = 0;
+   samsung,dsim-config-e-pixel-format = 7;
+   samsung,dsim-config-e-burst-mode = 1;
+   samsung,dsim-config-e-no-data-lane = 3;
+   samsung,dsim-config-e-byte-clk = 0;
+   samsung,dsim-config-hfp = 1;
+
+   samsung,dsim-config-p = 3;
+   samsung,dsim-config-m = 120;
+   samsung,dsim-config-s = 1;
+
+   samsung,dsim-config-pll-stable-time = 500;
+   samsung,dsim-config-esc-clk = 2000;
+   samsung,dsim-config-stop-holding-cnt = 0x7ff;
+   samsung,dsim-config-bta-timeout = 0xff;
+   samsung,dsim-config-rx-timeout = 0x;
+
+   samsung,dsim-device-id = 0x;
+   samsung,dsim-device-bus-id = 0;
+
+   samsung,dsim-device-reverse-panel = 1;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3

[U-Boot] [PATCH V4 12/12] board:trats2: Enable device tree on Trats2

2014-03-04 Thread Piotr Wilczek
This patch enables to run Trats2 board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
 - use - hypen in DT bindings
 - define CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, CONFIG_CMD_I2C at each board

Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - fixed mmc2 address in DT

 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos4412-trats2.dts | 434 +
 board/samsung/trats2/trats2.c  | 233 +---
 include/configs/trats2.h   | 204 -
 4 files changed, 483 insertions(+), 391 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-trats2.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 20c081e..fa6f496 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,6 +1,7 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
exynos4210-universal_c210.dtb \
-   exynos4210-trats.dtb
+   exynos4210-trats.dtb \
+   exynos4412-trats2.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4412-trats2.dts 
b/arch/arm/dts/exynos4412-trats2.dts
new file mode 100644
index 000..7d32067
--- /dev/null
+++ b/arch/arm/dts/exynos4412-trats2.dts
@@ -0,0 +1,434 @@
+/*
+ * Samsung's Exynos4412 based Trats2 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats2 based on Exynos4412;
+   compatible = samsung,trats2, samsung,exynos4412;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   i2c@138d {
+   samsung,i2c-sda-delay = 100;
+   samsung,i2c-slave-addr = 0x10;
+   samsung,i2c-max-bus-freq = 10;
+   status = okay;
+
+   max77686_pmic@09 {
+   compatible = maxim,max77686_pmic;
+   interrupts = 7 0;
+   reg = 0x09 0 0;
+   #clock-cells = 1;
+
+   voltage-regulators {
+   ldo1_reg: ldo1 {
+   regulator-compatible = LDO1;
+   regulator-name = VALIVE_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo2_reg: ldo2 {
+   regulator-compatible = LDO2;
+   regulator-name = VM1M2_1.2V_AP;
+   regulator-min-microvolt = 120;
+   regulator-max-microvolt = 120;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo3_reg: ldo3 {
+   regulator-compatible = LDO3;
+   regulator-name = VCC_1.8V_AP;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo4_reg: ldo4 {
+   regulator-compatible = LDO4;
+   regulator-name = VCC_2.8V_AP;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo5_reg: ldo5 {
+   regulator-compatible = LDO5;
+   regulator-name = VCC_1.8V_IO

Re: [U-Boot] [PATCH V4 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-03-04 Thread Piotr Wilczek

Hi Ajay,

On 03/05/2014 07:16 AM, Ajay kumar wrote:

Piotr,

You need to add the documentation for the bindings you create.
Please add a exynos_mipi_dsi.txt file under the directory:
doc/device-tree-bindings/video/


Yes, I completely overlook that, thanks.

Best regards,
Piotr Wilczek


Regards,
Ajay Kumar


On Tue, Mar 4, 2014 at 7:25 PM, Piotr Wilczek p.wilc...@samsung.com wrote:


This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
  - use - hypen for DT bindings

Changes for v3:
  - none

Changes for v2:
  - removed panel specific init function 's6e8ax0_init' to the board file

  arch/arm/include/asm/arch-exynos/mipi_dsim.h |  5 ++
  drivers/video/exynos_mipi_dsi.c  | 96

  include/fdtdec.h |  1 +
  lib/fdtdec.c |  1 +
  4 files changed, 103 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..50e5c25 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@

  #include linux/list.h
  #include linux/fb.h
+#include lcd.h

  #define PANEL_NAME_SIZE(32)

@@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct
mipi_dsim_lcd_device
 *lcd_dev);

  void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);

  /* panel driver init based on mipi dsi interface */
  void s6e8ax0_init(void);

+#ifdef CONFIG_OF_CONTROL
+extern int mipi_power(void);
+#endif
  #endif /* _DSIM_H */
diff --git a/drivers/video/exynos_mipi_dsi.c
b/drivers/video/exynos_mipi_dsi.c
index 8bb8fea..7dd4652 100644
--- a/drivers/video/exynos_mipi_dsi.c
+++ b/drivers/video/exynos_mipi_dsi.c
@@ -9,6 +9,8 @@

  #include common.h
  #include malloc.h
+#include fdtdec.h
+#include libfdt.h
  #include linux/err.h
  #include asm/arch/dsim.h
  #include asm/arch/mipi_dsim.h
@@ -22,7 +24,14 @@
  #define master_to_driver(a)(a-dsim_lcd_drv)
  #define master_to_device(a)(a-dsim_lcd_dev)

+DECLARE_GLOBAL_DATA_PTR;
+
  static struct exynos_platform_mipi_dsim *dsim_pd;
+#ifdef CONFIG_OF_CONTROL
+static struct mipi_dsim_config dsim_config_dt;
+static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
+static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
+#endif

  struct mipi_dsim_ddi {
 int bus_id;
@@ -238,3 +247,90 @@ void exynos_set_dsim_platform_data(struct
exynos_platform_mipi_dsim *pd)

 dsim_pd = pd;
  }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_dsim_config_parse_dt(const void *blob)
+{
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0,
COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
+   if (node = 0) {
+   printf(exynos_mipi_dsi: Can't get device node for mipi
dsi\n);
+   return -ENODEV;
+   }
+
+   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-interface, 0);
+
+   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-virtual-ch, 0);
+
+   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-pixel-format, 0);
+
+   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-burst-mode, 0);
+
+   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-no-data-lane, 0);
+
+   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e-byte-clk, 0);
+
+   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
+   samsung,dsim-config-hfp, 0);
+
+   dsim_config_dt.p = fdtdec_get_int(blob, node,
+ samsung,dsim-config-p, 0);
+   dsim_config_dt.m = fdtdec_get_int(blob, node,
+ samsung,dsim-config-m, 0);
+   dsim_config_dt.s = fdtdec_get_int(blob, node,
+ samsung,dsim-config-s, 0);
+
+   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
+   samsung,dsim-config-pll-stable-time, 0);
+
+   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-esc-clk, 0);
+
+   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
+   samsung,dsim-config-stop-holding-cnt, 0);
+
+   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node

Re: [U-Boot] [PATCH V4 03/12] video:exynos_fb:fdt: add additional fdt data

2014-03-04 Thread Piotr Wilczek

Hi Ajay,

On 03/05/2014 07:06 AM, Ajay kumar wrote:

Piotr,

Sorry for late reply.
Can you change the name of exynos_lcd_panel_init
to exynos_lcd_misc_init. panel_init definitely gives a wrong meaning.


Yes, I can.


And, can you let me know where you are actually using
panel_info.resolution? Is it needed for FIMD or is it needed by MIPI-DSI?
If it is MIPI specific, then it should come as a DT entry from MIPI-DSI
node.


Well, it looks like it is not used any more. I will remove it completely.


Also, if you add a new DT entry, please update the following file:
doc/device-tree-bindings/video/exynos-fb.txt


Ok.


Regards,
Ajay Kumar




Best regards,
Piotr Wilczek



On Tue, Mar 4, 2014 at 7:25 PM, Piotr Wilczek p.wilc...@samsung.com wrote:


This patch adds additional data parsing from DTB and adds the new
exynos_lcd_panel_init() function for panel specific initialisation
from the board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v4:
  - remove duplicated DT properties at exynos_fb.c file

Changes for v3:
  - none

Changes for v2:
  - removed duplicate DTB node parsing for panel_info.logo_on
  - added (weak) exynos_lcd_panel_init function for panel specific
 initialisation from board file

  drivers/video/exynos_fb.c | 15 +++
  1 file changed, 15 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 00a0a11..77a3186 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
  void exynos_backlight_reset(void)
 __attribute__((weak, alias(__exynos_backlight_reset)));

+int __exynos_lcd_panel_init(vidinfo_t *vid)
+{
+   return 0;
+}
+int exynos_lcd_panel_init(vidinfo_t *vid)
+   __attribute__((weak, alias(__exynos_lcd_panel_init)));
+
  static void lcd_panel_on(vidinfo_t *vid)
  {
 udelay(vid-init_delay);
@@ -269,6 +276,9 @@ int exynos_fimd_parse_dt(const void *blob)
 panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,

samsung,dual-lcd-enabled, 0);

+   panel_info.resolution = fdtdec_get_int(blob, node,
+   samsung,resolution, 0);
+
 return 0;
  }
  #endif
@@ -281,10 +291,15 @@ void lcd_ctrl_init(void *lcdbase)
  #ifdef CONFIG_OF_CONTROL
 if (exynos_fimd_parse_dt(gd-fdt_blob))
 debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
+   exynos_lcd_panel_init(panel_info);
  #else
 /* initialize parameters which is specific to panel. */
 init_panel_info(panel_info);
  #endif
+
 panel_width = panel_info.vl_width;
 panel_height = panel_info.vl_height;

--
1.8.3.2

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





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




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


Re: [U-Boot] [PATCH V3 03/12] video:exynos_fb:fdt: add additional fdt data

2014-02-28 Thread Piotr Wilczek

Hi Ajay,

Thank you for review. Please see answers below.

On 02/27/2014 03:10 PM, Ajay kumar wrote:

Piotr,

Adding more comments.

On Thu, Feb 27, 2014 at 10:50 PM, Ajay kumar ajayn...@gmail.com wrote:


Hi Piotr,
Find my comments inline.


On Tue, Feb 25, 2014 at 11:33 PM, Piotr Wilczek p.wilc...@samsung.comwrote:


This patch adds additional data parsing from DTB and adds the new
exynos_lcd_panel_init() function for panel specific initialisation
from the board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
  - none

Changes for v2:
  - removed duplicate DTB node parsing for panel_info.logo_on
  - added (weak) exynos_lcd_panel_init function for panel specific
 initialisation from board file

  drivers/video/exynos_fb.c | 21 +
  1 file changed, 21 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 00a0a11..88d9037 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
  void exynos_backlight_reset(void)
 __attribute__((weak, alias(__exynos_backlight_reset)));

+int __exynos_lcd_panel_init(vidinfo_t *vid)
+{
+   return 0;
+}
+int exynos_lcd_panel_init(vidinfo_t *vid)
+   __attribute__((weak, alias(__exynos_lcd_panel_init)));
+


This is redundant! We already have exynos_cfg_lcd_gpio, exynos_lcd_power_on
and other similar functions to support panel init.
The 'init_panel_info' is used to init lcd panel from he board file. It 
is called when CONFIG_OF_CONTROL is not defined. When CONFIG_OF_CONTROL 
is defined then we init panel from DTB data in exynos_fimd_parse_dt 
function.


However, it may be necessary to do some additional initializations that 
are optional and board specific. That’s what 'exynos_lcd_panel_init' 
function is for.



Please check board/samsung/smdk5250.c

smdk5250.c is compiled when CONFIG_OF_CONTROL is not defined.
With CONFIG_OF_CONTROL enabled, the exynos5-dt.c is used but it does not 
implement 'init_panel_info' so I would get undefined reference to 
'init_panel_info'. Tahts another reason that I introduced the above 
function.





  static void lcd_panel_on(vidinfo_t *vid)
  {
 udelay(vid-init_delay);
@@ -269,6 +276,15 @@ int exynos_fimd_parse_dt(const void *blob)
 panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,

samsung,dual-lcd-enabled, 0);

+   panel_info.resolution = fdtdec_get_int(blob, node,
+   samsung,resolution, 0);
+
+   panel_info.rgb_mode = fdtdec_get_int(blob, node,
+   samsung,rgb-mode, 0);
+
+   panel_info.power_on_delay = fdtdec_get_int(blob, node,
+   samsung,power-on-delay,
0);
+


All the above DT properties are already present in the same file!
This are definitely duplicate entries.
Right, rgb_mode and power_on_delay I was supposed to remove in the 
previous version but overlooked that, thanks.



For passing resolution, please use samsung,vl-col and samsung,vl-row
Previously HD_RESOLUTION was assigned to panel_info.resolution. It is 
defined as 0 in libtizen.h.





 return 0;
  }
  #endif
@@ -281,10 +297,15 @@ void lcd_ctrl_init(void *lcdbase)
  #ifdef CONFIG_OF_CONTROL
 if (exynos_fimd_parse_dt(gd-fdt_blob))
 debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
+   exynos_lcd_panel_init(panel_info);


This is already present as part of lcd_enable in same file!
Please check it.


Ok. I just heard from MIPI-DSI engineer that MIPI-DSI should
usually be initialized before FIMD video output starts.

Is that the reason why you are trying to do panel_init here?
That seems ok, but definitely you should not be using a new
function for that.
exynos_lcd_panel_init function is supposed to do only additional (to 
exynos_fimd_parse_dt) initializations like ex: get_tizen_logo_info.




Use something like below snippet:

/* exynos_fb.c */
.
lcd_ctrl_init()
{.
.
.
if(CONFIG_EXYNOS_MIPI...)
call lcd_panel_on  /* MIPI-DSI to be initialized before FIMD init */
.
do exynos_lcd_init() /* FIMD init */
.
}
.
.
.
.
lcd_enable()
{
.
.
if(CONFIG_EXYNOS_DP...)
call lcd_panel_on /* DP to be initialized after FIMD init */
.
.
}


   #else

 /* initialize parameters which is specific to panel. */
 init_panel_info(panel_info);
  #endif
+
 panel_width = panel_info.vl_width;
 panel_height = panel_info.vl_height;

--
1.8.3.2

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




Regards,
Ajay Kumar



Regards,
Ajay Kumar



___
U-Boot mailing list
U-Boot

Re: [U-Boot] [PATCH V3 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-02-27 Thread Piotr Wilczek

Hi Ajay,

On 02/27/2014 03:59 PM, Ajay kumar wrote:

Piotr,

DT bindings should usually be free of _ (underscore)
Please use hyphen: -

I will use hypen.


On Tue, Feb 25, 2014 at 11:33 PM, Piotr Wilczek p.wilc...@samsung.comwrote:


This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
  - none

Changes for v2:
  - removed panel specific init function 's6e8ax0_init' to the board file

  arch/arm/include/asm/arch-exynos/mipi_dsim.h |  5 ++
  drivers/video/exynos_mipi_dsi.c  | 96

  include/fdtdec.h |  1 +
  lib/fdtdec.c |  1 +
  4 files changed, 103 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..50e5c25 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@

  #include linux/list.h
  #include linux/fb.h
+#include lcd.h

  #define PANEL_NAME_SIZE(32)

@@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct
mipi_dsim_lcd_device
 *lcd_dev);

  void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);

  /* panel driver init based on mipi dsi interface */
  void s6e8ax0_init(void);

+#ifdef CONFIG_OF_CONTROL
+extern int mipi_power(void);
+#endif
  #endif /* _DSIM_H */
diff --git a/drivers/video/exynos_mipi_dsi.c
b/drivers/video/exynos_mipi_dsi.c
index 8bb8fea..6c10f11 100644
--- a/drivers/video/exynos_mipi_dsi.c
+++ b/drivers/video/exynos_mipi_dsi.c
@@ -9,6 +9,8 @@

  #include common.h
  #include malloc.h
+#include fdtdec.h
+#include libfdt.h
  #include linux/err.h
  #include asm/arch/dsim.h
  #include asm/arch/mipi_dsim.h
@@ -22,7 +24,14 @@
  #define master_to_driver(a)(a-dsim_lcd_drv)
  #define master_to_device(a)(a-dsim_lcd_dev)

+DECLARE_GLOBAL_DATA_PTR;
+
  static struct exynos_platform_mipi_dsim *dsim_pd;
+#ifdef CONFIG_OF_CONTROL
+static struct mipi_dsim_config dsim_config_dt;
+static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
+static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
+#endif

  struct mipi_dsim_ddi {
 int bus_id;
@@ -238,3 +247,90 @@ void exynos_set_dsim_platform_data(struct
exynos_platform_mipi_dsim *pd)

 dsim_pd = pd;
  }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_dsim_config_parse_dt(const void *blob)
+{
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0,
COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
+   if (node = 0) {
+   printf(exynos_mipi_dsi: Can't get device node for mipi
dsi\n);
+   return -ENODEV;
+   }
+
+   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_interface, 0);
+
+   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_virtual_ch, 0);
+
+   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_pixel_format, 0);
+
+   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_burst_mode, 0);
+
+   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_no_data_lane, 0);
+
+   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_byte_clk, 0);
+
+   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
+   samsung,dsim-config-hfp, 0);
+
+   dsim_config_dt.p = fdtdec_get_int(blob, node,
+ samsung,dsim-config-p, 0);
+   dsim_config_dt.m = fdtdec_get_int(blob, node,
+ samsung,dsim-config-m, 0);
+   dsim_config_dt.s = fdtdec_get_int(blob, node,
+ samsung,dsim-config-s, 0);
+
+   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
+   samsung,dsim-config-pll_stable_time, 0);
+
+   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-esc_clk, 0);
+
+   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
+   samsung,dsim-config-stop_holding_cnt, 0);
+
+   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-bta_timeout, 0);
+
+   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-rx_timeout, 0

[U-Boot] [PATCH V3 00/12] Exynos4: add support for device tree

2014-02-25 Thread Piotr Wilczek
This patch set enables support for device tree on all Exynos4 based boards.

DT support is enabled on Exynos mipi dsim and sdhci drives.
Common board.c file is reused for all functions common for
Exynos4 boards. Board specific files are implemented in the board files.
Origen, Universal, Trats and Trats2 boards are modifed to support device tree.

Changes for v3:
 - moved max77686 init function to smdk5250 board file
 - board DTS files moved to arch/arm/dts
 - rebased on the latest tree

Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id
 - removed unnecesary white space
 - removed panel specific init function 's6e8ax0_init' to the board file
 - removed duplicate DTB node parsing for panel_info.logo_on
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file
 - fixed checking for SDMMC boundary
 - fiex debug message
 - fixed comment to 'pwr_gpio' struct filed
 - new patch to move checkboard to common file
 - reuse existing common board.c file
 - new patch that removes unused max77686_init function
 - fixed mmc2 addres in DT on Trats2

Piotr Wilczek (12):
  exynos4:pinmux:fdt: decode peripheral id
  video:mipidsim:fdt: Add DT support for mipi dsim driver
  video:exynos_fb:fdt: add additional fdt data
  drivers:mmc:sdhci: enable support for DT
  board:samsung: move checkboard to common file
  arm:exynos: add common DTS file for exynos 4
  board:samsung:common: move max77686 init function
  arm:exynos: enable sdhci and misc_init to common board
  board:origen: Enable device tree on Origen
  board:universal: Enable device tree on Universal
  board:trats: Enable device tree on Trats
  board:trats2: Enable device tree on Trats2

Piotr Wilczek (12):
  exynos4:pinmux:fdt: decode peripheral id
  video:mipidsim:fdt: Add DT support for mipi dsim driver
  video:exynos_fb:fdt: add additional fdt data
  drivers:mmc:sdhci: enable support for DT
  board:samsung: move checkboard to common file
  arm:exynos: add common DTS file for exynos 4
  board:samsung:common: move max77686 init function
  arm:exynos: enable sdhci and misc_init to common board
  board:origen: Enable device tree on Origen
  board:universal: Enable device tree on Universal
  board:trats: Enable device tree on Trats
  board:trats2: Enable device tree on Trats2

 arch/arm/cpu/armv7/exynos/pinmux.c   |  17 ++
 arch/arm/dts/Makefile|   5 +
 arch/arm/dts/exynos4.dtsi| 139 +
 arch/arm/dts/exynos4210-origen.dts   |  45 +++
 arch/arm/dts/exynos4210-trats.dts| 120 
 arch/arm/dts/exynos4210-universal_c210.dts   |  83 +
 arch/arm/dts/exynos4412-trats2.dts   | 434 +++
 arch/arm/include/asm/arch-exynos/board.h |  12 +
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |   5 +
 arch/arm/include/asm/arch-exynos/mmc.h   |   7 +
 board/samsung/common/board.c | 180 ---
 board/samsung/origen/origen.c| 112 +--
 board/samsung/smdk5250/exynos5-dt.c  |  15 -
 board/samsung/smdk5250/smdk5250.c| 125 
 board/samsung/smdk5420/smdk5420.c|  15 -
 board/samsung/trats/trats.c  | 213 +
 board/samsung/trats2/trats2.c| 233 +-
 board/samsung/universal_c210/universal.c | 204 -
 drivers/mmc/s5p_sdhci.c  | 129 
 drivers/video/exynos_fb.c|  21 ++
 drivers/video/exynos_mipi_dsi.c  |  96 ++
 include/configs/exynos4-dt.h | 144 +
 include/configs/origen.h | 117 +++-
 include/configs/s5pc210_universal.h  | 145 +++--
 include/configs/trats.h  | 192 +++-
 include/configs/trats2.h | 198 ++--
 include/fdtdec.h |   2 +
 include/sdhci.h  |   5 +
 lib/fdtdec.c |   2 +
 29 files changed, 1683 insertions(+), 1332 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 arch/arm/dts/exynos4210-origen.dts
 create mode 100644 arch/arm/dts/exynos4210-trats.dts
 create mode 100644 arch/arm/dts/exynos4210-universal_c210.dts
 create mode 100644 arch/arm/dts/exynos4412-trats2.dts
 create mode 100644 include/configs/exynos4-dt.h

-- 
1.8.3.2

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


[U-Boot] [PATCH V3 01/12] exynos4:pinmux:fdt: decode peripheral id

2014-02-25 Thread Piotr Wilczek
This patch adds api to decode peripheral id based on interrupt number.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id
 - removed unnecesary white space

 arch/arm/cpu/armv7/exynos/pinmux.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 645c497..8d6e5c1 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -741,6 +741,21 @@ int exynos_pinmux_config(int peripheral, int flags)
 }
 
 #ifdef CONFIG_OF_CONTROL
+static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
+{
+   int err;
+   u32 cell[3];
+
+   err = fdtdec_get_int_array(blob, node, interrupts, cell,
+   ARRAY_SIZE(cell));
+   if (err) {
+   debug( invalid peripheral id\n);
+   return PERIPH_ID_NONE;
+   }
+
+   return cell[1];
+}
+
 static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 {
int err;
@@ -758,6 +773,8 @@ int pinmux_decode_periph_id(const void *blob, int node)
 {
if (cpu_is_exynos5())
return  exynos5_pinmux_decode_periph_id(blob, node);
+   else if (cpu_is_exynos4())
+   return  exynos4_pinmux_decode_periph_id(blob, node);
else
return PERIPH_ID_NONE;
 }
-- 
1.8.3.2

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


[U-Boot] [PATCH V3 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-02-25 Thread Piotr Wilczek
This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - removed panel specific init function 's6e8ax0_init' to the board file

 arch/arm/include/asm/arch-exynos/mipi_dsim.h |  5 ++
 drivers/video/exynos_mipi_dsi.c  | 96 
 include/fdtdec.h |  1 +
 lib/fdtdec.c |  1 +
 4 files changed, 103 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..50e5c25 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@
 
 #include linux/list.h
 #include linux/fb.h
+#include lcd.h
 
 #define PANEL_NAME_SIZE(32)
 
@@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct 
mipi_dsim_lcd_device
*lcd_dev);
 
 void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
 /* panel driver init based on mipi dsi interface */
 void s6e8ax0_init(void);
 
+#ifdef CONFIG_OF_CONTROL
+extern int mipi_power(void);
+#endif
 #endif /* _DSIM_H */
diff --git a/drivers/video/exynos_mipi_dsi.c b/drivers/video/exynos_mipi_dsi.c
index 8bb8fea..6c10f11 100644
--- a/drivers/video/exynos_mipi_dsi.c
+++ b/drivers/video/exynos_mipi_dsi.c
@@ -9,6 +9,8 @@
 
 #include common.h
 #include malloc.h
+#include fdtdec.h
+#include libfdt.h
 #include linux/err.h
 #include asm/arch/dsim.h
 #include asm/arch/mipi_dsim.h
@@ -22,7 +24,14 @@
 #define master_to_driver(a)(a-dsim_lcd_drv)
 #define master_to_device(a)(a-dsim_lcd_dev)
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static struct exynos_platform_mipi_dsim *dsim_pd;
+#ifdef CONFIG_OF_CONTROL
+static struct mipi_dsim_config dsim_config_dt;
+static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
+static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
+#endif
 
 struct mipi_dsim_ddi {
int bus_id;
@@ -238,3 +247,90 @@ void exynos_set_dsim_platform_data(struct 
exynos_platform_mipi_dsim *pd)
 
dsim_pd = pd;
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_dsim_config_parse_dt(const void *blob)
+{
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
+   if (node = 0) {
+   printf(exynos_mipi_dsi: Can't get device node for mipi dsi\n);
+   return -ENODEV;
+   }
+
+   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_interface, 0);
+
+   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_virtual_ch, 0);
+
+   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_pixel_format, 0);
+
+   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_burst_mode, 0);
+
+   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_no_data_lane, 0);
+
+   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_byte_clk, 0);
+
+   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
+   samsung,dsim-config-hfp, 0);
+
+   dsim_config_dt.p = fdtdec_get_int(blob, node,
+ samsung,dsim-config-p, 0);
+   dsim_config_dt.m = fdtdec_get_int(blob, node,
+ samsung,dsim-config-m, 0);
+   dsim_config_dt.s = fdtdec_get_int(blob, node,
+ samsung,dsim-config-s, 0);
+
+   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
+   samsung,dsim-config-pll_stable_time, 0);
+
+   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-esc_clk, 0);
+
+   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
+   samsung,dsim-config-stop_holding_cnt, 0);
+
+   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-bta_timeout, 0);
+
+   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-rx_timeout, 0);
+
+   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
+   samsung,dsim-device-name);
+
+   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node,
+   samsung,dsim-device-id, 0

[U-Boot] [PATCH V3 03/12] video:exynos_fb:fdt: add additional fdt data

2014-02-25 Thread Piotr Wilczek
This patch adds additional data parsing from DTB and adds the new
exynos_lcd_panel_init() function for panel specific initialisation
from the board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - removed duplicate DTB node parsing for panel_info.logo_on
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file

 drivers/video/exynos_fb.c | 21 +
 1 file changed, 21 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 00a0a11..88d9037 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
 void exynos_backlight_reset(void)
__attribute__((weak, alias(__exynos_backlight_reset)));
 
+int __exynos_lcd_panel_init(vidinfo_t *vid)
+{
+   return 0;
+}
+int exynos_lcd_panel_init(vidinfo_t *vid)
+   __attribute__((weak, alias(__exynos_lcd_panel_init)));
+
 static void lcd_panel_on(vidinfo_t *vid)
 {
udelay(vid-init_delay);
@@ -269,6 +276,15 @@ int exynos_fimd_parse_dt(const void *blob)
panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
samsung,dual-lcd-enabled, 0);
 
+   panel_info.resolution = fdtdec_get_int(blob, node,
+   samsung,resolution, 0);
+
+   panel_info.rgb_mode = fdtdec_get_int(blob, node,
+   samsung,rgb-mode, 0);
+
+   panel_info.power_on_delay = fdtdec_get_int(blob, node,
+   samsung,power-on-delay, 0);
+
return 0;
 }
 #endif
@@ -281,10 +297,15 @@ void lcd_ctrl_init(void *lcdbase)
 #ifdef CONFIG_OF_CONTROL
if (exynos_fimd_parse_dt(gd-fdt_blob))
debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
+   exynos_lcd_panel_init(panel_info);
 #else
/* initialize parameters which is specific to panel. */
init_panel_info(panel_info);
 #endif
+
panel_width = panel_info.vl_width;
panel_height = panel_info.vl_height;
 
-- 
1.8.3.2

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


[U-Boot] [PATCH V3 04/12] drivers:mmc:sdhci: enable support for DT

2014-02-25 Thread Piotr Wilczek
This patch enables support for device tree for sdhci driver.
Non DT case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - fixed checking for SDMMC boundary
 - fiex debug message
 - fixed comment to 'pwr_gpio' struct filed

 arch/arm/include/asm/arch-exynos/mmc.h |   7 ++
 drivers/mmc/s5p_sdhci.c| 129 +
 include/fdtdec.h   |   1 +
 include/sdhci.h|   5 ++
 lib/fdtdec.c   |   1 +
 5 files changed, 143 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mmc.h 
b/arch/arm/include/asm/arch-exynos/mmc.h
index 98d6530..0fb6461 100644
--- a/arch/arm/include/asm/arch-exynos/mmc.h
+++ b/arch/arm/include/asm/arch-exynos/mmc.h
@@ -53,6 +53,8 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x)  16)
 #define SDHCI_CTRL4_DRIVE_SHIFT(16)
 
+#define SDHCI_MAX_HOSTS 4
+
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
 static inline int s5p_mmc_init(int index, int bus_width)
@@ -62,4 +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
 
return s5p_sdhci_init(base, index, bus_width);
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_mmc_init(const void *blob);
+#endif
+
 #endif
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 40ff873..ccae4cc 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -8,8 +8,15 @@
 #include common.h
 #include malloc.h
 #include sdhci.h
+#include fdtdec.h
+#include libfdt.h
+#include asm/gpio.h
 #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)
@@ -86,3 +93,125 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 
return add_sdhci(host, 5200, 40);
 }
+
+#ifdef CONFIG_OF_CONTROL
+struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
+
+static int do_sdhci_init(struct sdhci_host *host)
+{
+   int dev_id, flag;
+   int err = 0;
+
+   flag = host-bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
+   dev_id = host-index + PERIPH_ID_SDMMC0;
+
+   if (fdt_gpio_isvalid(host-pwr_gpio)) {
+   gpio_direction_output(host-pwr_gpio.gpio, 1);
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   debug(MMC not configured\n);
+   return err;
+   }
+   }
+
+   if (fdt_gpio_isvalid(host-cd_gpio)) {
+   gpio_direction_output(host-cd_gpio.gpio, 0xf);
+   if (gpio_get_value(host-cd_gpio.gpio))
+   return -ENODEV;
+
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   printf(external SD not configured\n);
+   return err;
+   }
+   }
+
+   host-name = S5P_NAME;
+
+   host-quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
+   SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
+   SDHCI_QUIRK_WAIT_SEND_CMD;
+   host-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
+
+   host-set_control_reg = s5p_sdhci_set_control_reg;
+   host-set_clock = set_mmc_clk;
+
+   host-host_caps = MMC_MODE_HC;
+
+   return add_sdhci(host, 5200, 40);
+}
+
+static int sdhci_get_config(const void *blob, int node, struct sdhci_host 
*host)
+{
+   int bus_width, dev_id;
+   unsigned int base;
+
+   /* Get device id */
+   dev_id = pinmux_decode_periph_id(blob, node);
+   if (dev_id  PERIPH_ID_SDMMC0  dev_id  PERIPH_ID_SDMMC3) {
+   debug(MMC: Can't get device id\n);
+   return -1;
+   }
+   host-index = dev_id - PERIPH_ID_SDMMC0;
+
+   /* Get bus width */
+   bus_width = fdtdec_get_int(blob, node, samsung,bus-width, 0);
+   if (bus_width = 0) {
+   debug(MMC: Can't get bus-width\n);
+   return -1;
+   }
+   host-bus_width = bus_width;
+
+   /* Get the base address from the device node */
+   base = fdtdec_get_addr(blob, node, reg);
+   if (!base) {
+   debug(MMC: Can't get base address\n);
+   return -1;
+   }
+   host-ioaddr = (void *)base;
+
+   fdtdec_decode_gpio(blob, node, pwr-gpios, host-pwr_gpio);
+   fdtdec_decode_gpio(blob, node, cd-gpios, host-cd_gpio);
+
+   return 0;
+}
+
+static int process_nodes(const void *blob, int node_list[], int count)
+{
+   struct sdhci_host *host;
+   int i, node;
+
+   debug(%s: count = %d\n, __func__, count);
+
+   /* build sdhci_host[] for each controller

[U-Boot] [PATCH V3 05/12] board:samsung: move checkboard to common file

2014-02-25 Thread Piotr Wilczek
The checkboard function's implementation is common for all
DT supporting boards and should be placed in the board common file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Amar amarendra...@samsung.com

Acked-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - new patch

 board/samsung/common/board.c| 12 
 board/samsung/smdk5250/exynos5-dt.c | 15 ---
 board/samsung/smdk5420/smdk5420.c   | 15 ---
 3 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cd873bc..f8562b2 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -377,7 +377,19 @@ int board_mmc_init(bd_t *bis)
return ret;
 }
 #endif
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+   const char *board_name;
+
+   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
+   printf(Board: %s\n, board_name ? board_name : unknown);
+
+   return 0;
+}
 #endif
+#endif /* CONFIG_OF_CONTROL */
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index 5fb8664..b22fba5 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -45,21 +45,6 @@ int exynos_init(void)
return 0;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_LCD
 void exynos_cfg_lcd_gpio(void)
 {
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 3ad2ad0..e4606ec 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -142,18 +142,3 @@ int board_get_revision(void)
 {
return 0;
 }
-
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH V3 06/12] arm:exynos: add common DTS file for exynos 4

2014-02-25 Thread Piotr Wilczek
This patch adds common dtsi file and config header for all
Exynos 4 based boards.

Patch additionaly adds board specific (weak) functions for
board_early_init_f and board_power_init functions.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - reuse existing common board.c file

 arch/arm/dts/exynos4.dtsi| 139 +
 arch/arm/include/asm/arch-exynos/board.h |  12 +++
 board/samsung/common/board.c |  18 +++-
 include/configs/exynos4-dt.h | 144 +++
 4 files changed, 311 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 include/configs/exynos4-dt.h

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
new file mode 100644
index 000..38a6919
--- /dev/null
+++ b/arch/arm/dts/exynos4.dtsi
@@ -0,0 +1,139 @@
+/*
+ * Samsung's Exynos4 SoC common device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/include/ skeleton.dtsi
+
+/ {
+
+   serial@1380 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1380 0x3c;
+   id = 0;
+   };
+
+   serial@1381 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1381 0x3c;
+   id = 1;
+   };
+
+   serial@1382 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1382 0x3c;
+   id = 2;
+   };
+
+   serial@1383 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1383 0x3c;
+   id = 3;
+   };
+
+   serial@1384 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1384 0x3c;
+   id = 4;
+   };
+
+   i2c@1386 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 0 0 0;
+   };
+
+   i2c@1387 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 1 1 0;
+   };
+
+   i2c@1388 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 2 2 0;
+   };
+
+   i2c@1389 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 3 3 0;
+   };
+
+   i2c@138a {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 4 4 0;
+   };
+
+   i2c@138b {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 5 5 0;
+   };
+
+   i2c@138c {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 6 6 0;
+   };
+
+   i2c@138d {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 7 7 0;
+   };
+
+   sdhci@1251 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1251 0x1000;
+   interrupts = 0 75 0;
+   };
+
+   sdhci@1252 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1252 0x1000;
+   interrupts = 0 76 0;
+   };
+
+   sdhci@1253 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1253 0x1000;
+   interrupts = 0 77 0;
+   };
+
+   sdhci@1254 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1254 0x1000;
+   interrupts = 0 78 0;
+   };
+
+   gpio: gpio {
+   gpio-controller;
+   #gpio-cells = 2;
+
+   interrupt-controller;
+   #interrupt-cells = 2;
+   };
+};
diff --git a/arch/arm/include/asm/arch-exynos/board.h 
b/arch/arm/include/asm/arch-exynos/board.h
index 243fb12..1b1cd0d 100644
--- a/arch/arm/include/asm/arch-exynos/board.h
+++ b/arch/arm/include/asm/arch-exynos/board.h
@@ -14,4 +14,16 @@
  */
 int exynos_init(void);
 
+/*
+ * Exynos board specific changes

[U-Boot] [PATCH V3 07/12] board:samsung:common: move max77686 init function

2014-02-25 Thread Piotr Wilczek
This patch moves board specific max77686 init function from
common board to smdk5250 board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Rajeshwari Birje rajeshwari.bi...@gmail.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - max77686 init function is moved to smdk5250 board file

Changes for v2:
 - new patch

 board/samsung/common/board.c  | 120 
 board/samsung/smdk5250/smdk5250.c | 125 ++
 2 files changed, 125 insertions(+), 120 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cf78d36..a74b044 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,7 +22,6 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
-#include power/max77686_pmic.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -175,129 +174,10 @@ static int board_init_cros_ec_devices(const void *blob)
 #endif
 
 #if defined(CONFIG_POWER)
-#ifdef CONFIG_POWER_MAX77686
-static int pmic_reg_update(struct pmic *p, int reg, uint regval)
-{
-   u32 val;
-   int ret = 0;
-
-   ret = pmic_reg_read(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register read failed\n, __func__, reg);
-   return -1;
-   }
-   val |= regval;
-   ret = pmic_reg_write(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register write failed\n, __func__, reg);
-   return -1;
-   }
-   return 0;
-}
-
-static int max77686_init(void)
-{
-   struct pmic *p;
-
-   if (pmic_init(I2C_PMIC))
-   return -1;
-
-   p = pmic_get(MAX77686_PMIC);
-   if (!p)
-   return -ENODEV;
-
-   if (pmic_probe(p))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ, MAX77686_32KHCP_EN))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT,
-   MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V))
-   return -1;
-
-   /* VDD_MIF */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT,
-  MAX77686_BUCK1OUT_1V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK1OUT);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL,
-   MAX77686_BUCK1CTRL_EN))
-   return -1;
-
-   /* VDD_ARM */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1,
-  MAX77686_BUCK2DVS1_1_3V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK2DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1,
-   MAX77686_BUCK2CTRL_ON))
-   return -1;
-
-   /* VDD_INT */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1,
-  MAX77686_BUCK3DVS1_1_0125V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK3DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_G3D */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1,
-  MAX77686_BUCK4DVS1_1_2V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK4DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK4CTRL1,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_LDO2 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO2CTRL1,
-   MAX77686_LD02CTRL1_1_5V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO3 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO3CTRL1,
-   MAX77686_LD03CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO5 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO5CTRL1,
-   MAX77686_LD05CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO10 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO10CTRL1,
-   MAX77686_LD10CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   return 0;
-}
-#endif
-
 int power_init_board(void)
 {
-   int ret = 0;
-
set_ps_hold_ctrl();
 
-#ifdef CONFIG_POWER_MAX77686
-   ret = max77686_init();
-#endif
-
return exynos_power_init();
 }
 #endif
diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index a69f73d..28a6d9e 100644
--- a/board/samsung/smdk5250/smdk5250

[U-Boot] [PATCH V3 08/12] arm:exynos: enable sdhci and misc_init to common board

2014-02-25 Thread Piotr Wilczek
This patch enables sdhci initialisation and misc_init_r in common board
file for all exynos 4 based boards.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - none

Changes for v2:
 - new patch

 board/samsung/common/board.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index a74b044..e95e9c4 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,6 +22,8 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
+#include lcd.h
+#include samsung/misc.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -183,6 +185,7 @@ int power_init_board(void)
 #endif
 
 #ifdef CONFIG_OF_CONTROL
+#ifdef CONFIG_SMC911X
 static int decode_sromc(const void *blob, struct fdt_sromc *config)
 {
int err;
@@ -206,6 +209,7 @@ static int decode_sromc(const void *blob, struct fdt_sromc 
*config)
}
return 0;
 }
+#endif
 
 int board_eth_init(bd_t *bis)
 {
@@ -263,10 +267,18 @@ int board_mmc_init(bd_t *bis)
 {
int ret;
 
+#ifdef CONFIG_SDHCI
+   /* mmc initializattion for available channels */
+   ret = exynos_mmc_init(gd-fdt_blob);
+   if (ret)
+   debug(mmc init failed\n);
+#endif
+#ifdef CONFIG_DWMMC
/* dwmmc initializattion for available channels */
ret = exynos_dwmmc_init(gd-fdt_blob);
if (ret)
debug(dwmmc init failed\n);
+#endif
 
return ret;
 }
@@ -315,3 +327,21 @@ int arch_early_init_r(void)
 
return 0;
 }
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
+#ifdef CONFIG_LCD_MENU
+   keys_init();
+   check_boot_mode();
+#endif
+#ifdef CONFIG_CMD_BMP
+   if (panel_info.logo_on)
+   draw_logo();
+#endif
+   return 0;
+}
+#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH V3 11/12] board:trats: Enable device tree on Trats

2014-02-25 Thread Piotr Wilczek
This patch enables to run Trats board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
CC: Lukasz Majewski l.majew...@samsung.com
---
Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes
 
 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/exynos4210-trats.dts | 120 +
 board/samsung/trats/trats.c   | 213 ++
 include/configs/trats.h   | 192 --
 4 files changed, 174 insertions(+), 354 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-trats.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d30954c..20c081e 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
-   exynos4210-universal_c210.dtb
+   exynos4210-universal_c210.dtb \
+   exynos4210-trats.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4210-trats.dts 
b/arch/arm/dts/exynos4210-trats.dts
new file mode 100644
index 000..79fdad2
--- /dev/null
+++ b/arch/arm/dts/exynos4210-trats.dts
@@ -0,0 +1,120 @@
+/*
+ * Samsung's Exynos4210 based Trats board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats based on Exynos4210;
+   compatible = samsung,trats, samsung,exynos4210;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 720;
+   samsung,vl-row = 1280;
+   samsung,vl-width = 720;
+   samsung,vl-height = 1280;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 5;
+   samsung,vl-hbpd = 10;
+   samsung,vl-hfpd = 10;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 1;
+   samsung,vl-vfpd = 13;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,winid = 3;
+   samsung,power-on-delay = 30;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 1;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+
+   mipidsi@11c8 {
+   compatible = samsung,exynos-mipi-dsi;
+   reg = 0x11c8 0x5c;
+
+   samsung,dsim-config-e_interface = 1;
+   samsung,dsim-config-e_virtual_ch = 0;
+   samsung,dsim-config-e_pixel_format = 7;
+   samsung,dsim-config-e_burst_mode = 1;
+   samsung,dsim-config-e_no_data_lane = 3;
+   samsung,dsim-config-e_byte_clk = 0;
+   samsung,dsim-config-hfp = 1;
+
+   samsung,dsim-config-p = 3;
+   samsung,dsim-config-m = 120;
+   samsung,dsim-config-s = 1;
+
+   samsung,dsim-config-pll_stable_time = 500;
+   samsung,dsim-config-esc_clk = 2000;
+   samsung,dsim-config-stop_holding_cnt = 0x7ff;
+   samsung,dsim-config-bta_timeout = 0xff;
+   samsung,dsim-config-rx_timeout = 0x;
+
+   samsung,dsim-device-id = 0x;
+   samsung,dsim-device-bus_id = 0;
+
+   samsung,dsim-device-reverse_panel = 1;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled

[U-Boot] [PATCH V3 09/12] board:origen: Enable device tree on Origen

2014-02-25 Thread Piotr Wilczek
This patch enables to run Origen board on device tree.

Uart, DRAM and MMC init functions are removed as their
generic replacements form the common board file are used.

The config file is modified to contain only board specific options.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile  |   2 +
 arch/arm/dts/exynos4210-origen.dts |  45 ++
 board/samsung/origen/origen.c  | 112 +++
 include/configs/origen.h   | 117 +
 4 files changed, 96 insertions(+), 180 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-origen.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2658911..7abca75 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,3 +1,5 @@
+dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb
+
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
exynos5250-smdk5250.dtb \
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
new file mode 100644
index 000..5c9d2ae
--- /dev/null
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -0,0 +1,45 @@
+/*
+ * Samsung's Exynos4210 based Origen board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ skeleton.dtsi
+/include/ exynos4.dtsi
+
+/ {
+   model = Insignal Origen evaluation board based on Exynos4210;
+   compatible = insignal,origen, samsung,exynos4210;
+
+   chosen {
+   bootargs =;
+   };
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   status = disabled;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 15f77ca..d502f02 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -11,129 +11,35 @@
 #include asm/arch/mmc.h
 #include asm/arch/periph.h
 #include asm/arch/pinmux.h
+#include usb.h
 
 DECLARE_GLOBAL_DATA_PTR;
-struct exynos4_gpio_part1 *gpio1;
-struct exynos4_gpio_part2 *gpio2;
 
-int board_init(void)
+u32 get_board_rev(void)
 {
-   gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
-   gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
-
-   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
return 0;
 }
 
-static int board_uart_init(void)
+int exynos_init(void)
 {
-   int err;
-
-   err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART0 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART1 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART2 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART3 not configured\n);
-   return err;
-   }
-
return 0;
 }
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
-{
-   int err;
-   err = board_uart_init();
-   if (err) {
-   debug(UART init failed\n);
-   return err;
-   }
-   return err;
-}
-#endif
-
-int dram_init(void)
+int board_usb_init(int index, enum usb_init_type init)
 {
-   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
-
return 0;
 }
 
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \
-   PHYS_SDRAM_1_SIZE);
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2

[U-Boot] [PATCH V3 12/12] board:trats2: Enable device tree on Trats2

2014-02-25 Thread Piotr Wilczek
This patch enables to run Trats2 board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - fixed mmc2 address in DT

 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos4412-trats2.dts | 434 +
 board/samsung/trats2/trats2.c  | 233 +---
 include/configs/trats2.h   | 198 +++--
 4 files changed, 476 insertions(+), 392 deletions(-)
 create mode 100644 arch/arm/dts/exynos4412-trats2.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 20c081e..fa6f496 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,6 +1,7 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
exynos4210-universal_c210.dtb \
-   exynos4210-trats.dtb
+   exynos4210-trats.dtb \
+   exynos4412-trats2.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4412-trats2.dts 
b/arch/arm/dts/exynos4412-trats2.dts
new file mode 100644
index 000..d31e780
--- /dev/null
+++ b/arch/arm/dts/exynos4412-trats2.dts
@@ -0,0 +1,434 @@
+/*
+ * Samsung's Exynos4412 based Trats2 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats2 based on Exynos4412;
+   compatible = samsung,trats2, samsung,exynos4412;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   i2c@138d {
+   samsung,i2c-sda-delay = 100;
+   samsung,i2c-slave-addr = 0x10;
+   samsung,i2c-max-bus-freq = 10;
+   status = okay;
+
+   max77686_pmic@09 {
+   compatible = maxim,max77686_pmic;
+   interrupts = 7 0;
+   reg = 0x09 0 0;
+   #clock-cells = 1;
+
+   voltage-regulators {
+   ldo1_reg: ldo1 {
+   regulator-compatible = LDO1;
+   regulator-name = VALIVE_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo2_reg: ldo2 {
+   regulator-compatible = LDO2;
+   regulator-name = VM1M2_1.2V_AP;
+   regulator-min-microvolt = 120;
+   regulator-max-microvolt = 120;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo3_reg: ldo3 {
+   regulator-compatible = LDO3;
+   regulator-name = VCC_1.8V_AP;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo4_reg: ldo4 {
+   regulator-compatible = LDO4;
+   regulator-name = VCC_2.8V_AP;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo5_reg: ldo5 {
+   regulator-compatible = LDO5;
+   regulator-name = VCC_1.8V_IO;
+   regulator-min-microvolt = 180;
+   regulator-max

[U-Boot] [PATCH V3 10/12] board:universal: Enable device tree on Universal

2014-02-25 Thread Piotr Wilczek
This patch enables to run Universal board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

Acked-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes for v3:
 - dts file moved to arch/arm/dts

Changes for v2:
 - no changes

 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos4210-universal_c210.dts |  83 
 board/samsung/universal_c210/universal.c   | 204 -
 include/configs/s5pc210_universal.h| 145 ++--
 4 files changed, 178 insertions(+), 257 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-universal_c210.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 7abca75..d30954c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,4 +1,5 @@
-dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb
+dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
+   exynos4210-universal_c210.dtb
 
 dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-snow.dtb \
diff --git a/arch/arm/dts/exynos4210-universal_c210.dts 
b/arch/arm/dts/exynos4210-universal_c210.dts
new file mode 100644
index 000..1cdd981
--- /dev/null
+++ b/arch/arm/dts/exynos4210-universal_c210.dts
@@ -0,0 +1,83 @@
+/*
+ * Samsung's Exynos4210 based Universal C210 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Universal C210 based on Exynos4210 rev0;
+   compatible = samsung,universal_c210, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 480;
+   samsung,vl-row = 800;
+   samsung,vl-width = 480;
+   samsung,vl-height = 800;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 2;
+   samsung,vl-hbpd = 16;
+   samsung,vl-hfpd = 16;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 8;
+   samsung,vl-vfpd = 8;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,pclk_name = 1;
+   samsung,sclk_div = 1;
+
+   samsung,winid = 0;
+   samsung,power-on-delay = 1;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 0;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+};
diff --git a/board/samsung/universal_c210/universal.c 
b/board/samsung/universal_c210/universal.c
index 96da7e0..82249d3 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -13,16 +13,17 @@
 #include asm/gpio.h
 #include asm/arch/adc.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/watchdog.h
-#include libtizen.h
 #include ld9040.h
 #include power/pmic.h
+#include usb.h
 #include usb/s3c_udc.h
 #include asm/arch/cpu.h
 #include power/max8998_pmic.h
+#include libtizen.h
 #include samsung/misc.h
+#include usb_mass_storage.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,7 +43,7 @@ static int get_hwrev(void)
 
 static void init_pmic_lcd(void);
 
-int power_init_board(void)
+int exynos_power_init(void)
 {
int ret;
 
@@ -59,22 +60,6 @@ int power_init_board(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) +
-   get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
-
-   return 0;
-}
-
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
-}
-
 static

Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function

2014-02-23 Thread Piotr Wilczek
Dear Minkyu Kang,

 -Original Message-
 From: Minkyu Kang [mailto:mk7.k...@samsung.com]
 Sent: Saturday, February 22, 2014 8:38 AM
 To: Rajeshwari Birje; Piotr Wilczek; Rajeshwari S Shinde
 Cc: Jaehoon Chung; u-boot@lists.denx.de; Kyungmin Park
 Subject: Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove
 unused max77686 init function
 
 Dear Rajeshwari and Piotr,
 
 On 14/02/14 20:40, Rajeshwari Birje wrote:
  Hi Piotr,
 
  On Fri, Feb 14, 2014 at 3:18 PM, Piotr Wilczek
 p.wilc...@samsung.com wrote:
  Hi Rajeshwari,
 
  -Original Message-
  From: Rajeshwari Birje [mailto:rajeshwari.bi...@gmail.com]
  Sent: Friday, February 14, 2014 6:32 AM
  To: Piotr Wilczek
  Cc: u-boot@lists.denx.de; Jaehoon Chung; Kyungmin Park; Rajeshwari
 S
  Shinde
  Subject: Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove
  unused max77686 init function
 
  Hi Piotr,
 
  On Thu, Feb 13, 2014 at 7:40 PM, Piotr Wilczek
  p.wilc...@samsung.com
  wrote:
  This patch removes currently unused max77686_init function.
  Despite being not used, it's implementation is board specific.
 
  MAX77686 is required for 5250, but missed it somehow when adding
  5420 support and making a common config file for both. It is my
  mistake will correct the same You can refer:
  [U-Boot] [PATCH V5 0/6] SMDK5420: Add S2MPS11 pmic support to
  SMDK5420 by Leela Krishna Amudala It adds a generic way for PMIC
  support.
  http://lists.denx.de/pipermail/u-boot/2014-January/171113.html
 
  MAX77686 is also used at Trats2 so max77686_init must be either
  generic based on DT or moved to the board file.
 
  Generic in the sense you want all registers to be set and there
 values
  have to come from DT file?
  Which ever you feel OK is fine with me.
 
 
 So.. do you agree to apply this patch?
 or need another discussion?
 
I will move max77686_init to smdk5250 board file and prepare v3 of this
patch series.
Do you have any other comments to this series?

 Thanks,
 Minkyu Kang.

Best regards,
Piotr Wilczek



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


Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function

2014-02-14 Thread Piotr Wilczek
Hi Rajeshwari,

 -Original Message-
 From: Rajeshwari Birje [mailto:rajeshwari.bi...@gmail.com]
 Sent: Friday, February 14, 2014 6:32 AM
 To: Piotr Wilczek
 Cc: u-boot@lists.denx.de; Jaehoon Chung; Kyungmin Park; Rajeshwari S
 Shinde
 Subject: Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove
 unused max77686 init function
 
 Hi Piotr,
 
 On Thu, Feb 13, 2014 at 7:40 PM, Piotr Wilczek p.wilc...@samsung.com
 wrote:
  This patch removes currently unused max77686_init function.
  Despite being not used, it's implementation is board specific.
 
 MAX77686 is required for 5250, but missed it somehow when adding 5420
 support and making a common config file for both. It is my mistake will
 correct the same You can refer:
 [U-Boot] [PATCH V5 0/6] SMDK5420: Add S2MPS11 pmic support to
 SMDK5420 by Leela Krishna Amudala It adds a generic way for PMIC
 support.
 http://lists.denx.de/pipermail/u-boot/2014-January/171113.html
 
MAX77686 is also used at Trats2 so max77686_init must be either generic
based on DT or moved to the board file.

Best regards,
Piotr

 Regards,
 Rajeshwari
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
  Changes for v2:
   - new patch
 
   board/samsung/common/board.c |  120
  --
   1 file changed, 120 deletions(-)
 
  diff --git a/board/samsung/common/board.c
  b/board/samsung/common/board.c index cd873bc..3ac8005 100644
  --- a/board/samsung/common/board.c
  +++ b/board/samsung/common/board.c
  @@ -22,7 +22,6 @@
   #include asm/arch/power.h
   #include power/pmic.h
   #include asm/arch/sromc.h
  -#include power/max77686_pmic.h
 
   DECLARE_GLOBAL_DATA_PTR;
 
  @@ -160,133 +159,14 @@ static int board_init_cros_ec_devices(const
  void *blob)  }  #endif
 
  -#if defined(CONFIG_POWER)
  -#ifdef CONFIG_POWER_MAX77686
  -static int pmic_reg_update(struct pmic *p, int reg, uint regval) -{
  -   u32 val;
  -   int ret = 0;
  -
  -   ret = pmic_reg_read(p, reg, val);
  -   if (ret) {
  -   debug(%s: PMIC %d register read failed\n, __func__,
 reg);
  -   return -1;
  -   }
  -   val |= regval;
  -   ret = pmic_reg_write(p, reg, val);
  -   if (ret) {
  -   debug(%s: PMIC %d register write failed\n,
 __func__, reg);
  -   return -1;
  -   }
  -   return 0;
  -}
  -
  -static int max77686_init(void)
  -{
  -   struct pmic *p;
  -
  -   if (pmic_init(I2C_PMIC))
  -   return -1;
  -
  -   p = pmic_get(MAX77686_PMIC);
  -   if (!p)
  -   return -ENODEV;
  -
  -   if (pmic_probe(p))
  -   return -1;
  -
  -   if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ,
 MAX77686_32KHCP_EN))
  -   return -1;
  -
  -   if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT,
  -   MAX77686_BBCHOSTEN |
 MAX77686_BBCVS_3_5V))
  -   return -1;
  -
  -   /* VDD_MIF */
  -   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT,
  -  MAX77686_BUCK1OUT_1V)) {
  -   debug(%s: PMIC %d register write failed\n,
 __func__,
  - MAX77686_REG_PMIC_BUCK1OUT);
  -   return -1;
  -   }
  -
  -   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL,
  -   MAX77686_BUCK1CTRL_EN))
  -   return -1;
  -
  -   /* VDD_ARM */
  -   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1,
  -  MAX77686_BUCK2DVS1_1_3V)) {
  -   debug(%s: PMIC %d register write failed\n,
 __func__,
  - MAX77686_REG_PMIC_BUCK2DVS1);
  -   return -1;
  -   }
  -
  -   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1,
  -   MAX77686_BUCK2CTRL_ON))
  -   return -1;
  -
  -   /* VDD_INT */
  -   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1,
  -  MAX77686_BUCK3DVS1_1_0125V)) {
  -   debug(%s: PMIC %d register write failed\n,
 __func__,
  - MAX77686_REG_PMIC_BUCK3DVS1);
  -   return -1;
  -   }
  -
  -   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL,
  -   MAX77686_BUCK3CTRL_ON))
  -   return -1;
  -
  -   /* VDD_G3D */
  -   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1,
  -  MAX77686_BUCK4DVS1_1_2V)) {
  -   debug(%s: PMIC %d register write failed\n,
 __func__,
  - MAX77686_REG_PMIC_BUCK4DVS1);
  -   return -1;
  -   }
  -
  -   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK4CTRL1,
  -   MAX77686_BUCK3CTRL_ON))
  -   return -1;
  -
  -   /* VDD_LDO2 */
  -   if (pmic_reg_update(p

[U-Boot] [PATCH V2 00/12] Exynos4: add support for device tree

2014-02-13 Thread Piotr Wilczek
This patch set enables support for device tree on all Exynos4 based boards.

DT support is enabled on Exynos mipi dsim and sdhci drives.
Common board.c file is reused for all functions common for
Exynos4 boards. Board specific files are implemented in the board siles.
Origen, Universal, Trats and Trats2 boards are modifed to support device tree.

Piotr Wilczek (12):
  exynos4:pinmux:fdt: decode peripheral id
  video:mipidsim:fdt: Add DT support for mipi dsim driver
  video:exynos_fb:fdt: add additional fdt data
  drivers:mmc:sdhci: enable support for DT
  board:samsung:common: remove unused max77686 init function
  board:samsung: move checkboard to common file
  arm:exynos: add common DTS file for exynos 4
  arm:exynos: enble sdhci and misc_init to common board
  board:origen: Enable device tree on Origen
  board:universal: Enable device tree on Universal
  board:trats: Enable device tree on Trats
  board:trats2: Enable device tree on Trats2

 arch/arm/cpu/armv7/exynos/pinmux.c  |   17 +
 arch/arm/dts/exynos4.dtsi   |  139 
 arch/arm/include/asm/arch-exynos/board.h|   12 +
 arch/arm/include/asm/arch-exynos/mipi_dsim.h|5 +
 arch/arm/include/asm/arch-exynos/mmc.h  |7 +
 board/samsung/common/board.c|  182 +++---
 board/samsung/dts/exynos4210-origen.dts |   45 +++
 board/samsung/dts/exynos4210-trats.dts  |  120 +++
 board/samsung/dts/exynos4210-universal_c210.dts |   83 +
 board/samsung/dts/exynos4412-trats2.dts |  434 +++
 board/samsung/origen/origen.c   |  112 +-
 board/samsung/smdk5250/exynos5-dt.c |   15 -
 board/samsung/smdk5420/smdk5420.c   |   15 -
 board/samsung/trats/trats.c |  213 +--
 board/samsung/trats2/trats2.c   |  233 +---
 board/samsung/universal_c210/universal.c|  204 +++
 drivers/mmc/s5p_sdhci.c |  129 +++
 drivers/video/exynos_fb.c   |   21 ++
 drivers/video/exynos_mipi_dsi.c |   96 +
 include/configs/exynos4-dt.h|  144 
 include/configs/origen.h|  117 +++---
 include/configs/s5pc210_universal.h |  145 +++-
 include/configs/trats.h |  192 +++---
 include/configs/trats2.h|  198 ++-
 include/fdtdec.h|2 +
 include/sdhci.h |5 +
 lib/fdtdec.c|2 +
 27 files changed, 1553 insertions(+), 1334 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 board/samsung/dts/exynos4210-origen.dts
 create mode 100644 board/samsung/dts/exynos4210-trats.dts
 create mode 100644 board/samsung/dts/exynos4210-universal_c210.dts
 create mode 100644 board/samsung/dts/exynos4412-trats2.dts
 create mode 100644 include/configs/exynos4-dt.h

-- 
1.7.9.5

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


[U-Boot] [PATCH V2 01/12] exynos4:pinmux:fdt: decode peripheral id

2014-02-13 Thread Piotr Wilczek
This patch adds api to decode peripheral id based in interrupt number.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - removed incorrectly implemented check for invalid peripheral id;
 - removed unnecesary white space;
 
 arch/arm/cpu/armv7/exynos/pinmux.c |   17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 645c497..8d6e5c1 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -741,6 +741,21 @@ int exynos_pinmux_config(int peripheral, int flags)
 }
 
 #ifdef CONFIG_OF_CONTROL
+static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
+{
+   int err;
+   u32 cell[3];
+
+   err = fdtdec_get_int_array(blob, node, interrupts, cell,
+   ARRAY_SIZE(cell));
+   if (err) {
+   debug( invalid peripheral id\n);
+   return PERIPH_ID_NONE;
+   }
+
+   return cell[1];
+}
+
 static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 {
int err;
@@ -758,6 +773,8 @@ int pinmux_decode_periph_id(const void *blob, int node)
 {
if (cpu_is_exynos5())
return  exynos5_pinmux_decode_periph_id(blob, node);
+   else if (cpu_is_exynos4())
+   return  exynos4_pinmux_decode_periph_id(blob, node);
else
return PERIPH_ID_NONE;
 }
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 03/12] video:exynos_fb:fdt: add additional fdt data

2014-02-13 Thread Piotr Wilczek
This patch adds additional data parsing from DTB and adds the new
exynos_lcd_panel_init() function for panel specific initialisation
the from board file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - removed duplicate DTB node parsing for panel_info.logo_on;
 - added (weak) exynos_lcd_panel_init function for panel specific
initialisation from board file;

 drivers/video/exynos_fb.c |   21 +
 1 file changed, 21 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 00a0a11..88d9037 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
 void exynos_backlight_reset(void)
__attribute__((weak, alias(__exynos_backlight_reset)));
 
+int __exynos_lcd_panel_init(vidinfo_t *vid)
+{
+   return 0;
+}
+int exynos_lcd_panel_init(vidinfo_t *vid)
+   __attribute__((weak, alias(__exynos_lcd_panel_init)));
+
 static void lcd_panel_on(vidinfo_t *vid)
 {
udelay(vid-init_delay);
@@ -269,6 +276,15 @@ int exynos_fimd_parse_dt(const void *blob)
panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
samsung,dual-lcd-enabled, 0);
 
+   panel_info.resolution = fdtdec_get_int(blob, node,
+   samsung,resolution, 0);
+
+   panel_info.rgb_mode = fdtdec_get_int(blob, node,
+   samsung,rgb-mode, 0);
+
+   panel_info.power_on_delay = fdtdec_get_int(blob, node,
+   samsung,power-on-delay, 0);
+
return 0;
 }
 #endif
@@ -281,10 +297,15 @@ void lcd_ctrl_init(void *lcdbase)
 #ifdef CONFIG_OF_CONTROL
if (exynos_fimd_parse_dt(gd-fdt_blob))
debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
+   exynos_lcd_panel_init(panel_info);
 #else
/* initialize parameters which is specific to panel. */
init_panel_info(panel_info);
 #endif
+
panel_width = panel_info.vl_width;
panel_height = panel_info.vl_height;
 
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-02-13 Thread Piotr Wilczek
This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - removed panel specific init function 's6e8ax0_init' to the board file;

 arch/arm/include/asm/arch-exynos/mipi_dsim.h |5 ++
 drivers/video/exynos_mipi_dsi.c  |   96 ++
 include/fdtdec.h |1 +
 lib/fdtdec.c |1 +
 4 files changed, 103 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..50e5c25 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@
 
 #include linux/list.h
 #include linux/fb.h
+#include lcd.h
 
 #define PANEL_NAME_SIZE(32)
 
@@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct 
mipi_dsim_lcd_device
*lcd_dev);
 
 void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
 /* panel driver init based on mipi dsi interface */
 void s6e8ax0_init(void);
 
+#ifdef CONFIG_OF_CONTROL
+extern int mipi_power(void);
+#endif
 #endif /* _DSIM_H */
diff --git a/drivers/video/exynos_mipi_dsi.c b/drivers/video/exynos_mipi_dsi.c
index 8bb8fea..6c10f11 100644
--- a/drivers/video/exynos_mipi_dsi.c
+++ b/drivers/video/exynos_mipi_dsi.c
@@ -9,6 +9,8 @@
 
 #include common.h
 #include malloc.h
+#include fdtdec.h
+#include libfdt.h
 #include linux/err.h
 #include asm/arch/dsim.h
 #include asm/arch/mipi_dsim.h
@@ -22,7 +24,14 @@
 #define master_to_driver(a)(a-dsim_lcd_drv)
 #define master_to_device(a)(a-dsim_lcd_dev)
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static struct exynos_platform_mipi_dsim *dsim_pd;
+#ifdef CONFIG_OF_CONTROL
+static struct mipi_dsim_config dsim_config_dt;
+static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
+static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
+#endif
 
 struct mipi_dsim_ddi {
int bus_id;
@@ -238,3 +247,90 @@ void exynos_set_dsim_platform_data(struct 
exynos_platform_mipi_dsim *pd)
 
dsim_pd = pd;
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_dsim_config_parse_dt(const void *blob)
+{
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
+   if (node = 0) {
+   printf(exynos_mipi_dsi: Can't get device node for mipi dsi\n);
+   return -ENODEV;
+   }
+
+   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_interface, 0);
+
+   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_virtual_ch, 0);
+
+   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_pixel_format, 0);
+
+   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_burst_mode, 0);
+
+   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_no_data_lane, 0);
+
+   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_byte_clk, 0);
+
+   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
+   samsung,dsim-config-hfp, 0);
+
+   dsim_config_dt.p = fdtdec_get_int(blob, node,
+ samsung,dsim-config-p, 0);
+   dsim_config_dt.m = fdtdec_get_int(blob, node,
+ samsung,dsim-config-m, 0);
+   dsim_config_dt.s = fdtdec_get_int(blob, node,
+ samsung,dsim-config-s, 0);
+
+   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
+   samsung,dsim-config-pll_stable_time, 0);
+
+   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-esc_clk, 0);
+
+   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
+   samsung,dsim-config-stop_holding_cnt, 0);
+
+   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-bta_timeout, 0);
+
+   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-rx_timeout, 0);
+
+   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
+   samsung,dsim-device-name);
+
+   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node,
+   samsung,dsim-device-id, 0);
+
+   mipi_lcd_device_dt.bus_id

[U-Boot] [PATCH V2 04/12] drivers:mmc:sdhci: enable support for DT

2014-02-13 Thread Piotr Wilczek
This patch enables support for device tree for sdhci driver.
Non DT case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - fixed checking for SDMMC boundary;
 - fiex debug message;
 - fixed comment to 'pwr_gpio' struct filed;

 arch/arm/include/asm/arch-exynos/mmc.h |7 ++
 drivers/mmc/s5p_sdhci.c|  129 
 include/fdtdec.h   |1 +
 include/sdhci.h|5 ++
 lib/fdtdec.c   |1 +
 5 files changed, 143 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mmc.h 
b/arch/arm/include/asm/arch-exynos/mmc.h
index 98d6530..0fb6461 100644
--- a/arch/arm/include/asm/arch-exynos/mmc.h
+++ b/arch/arm/include/asm/arch-exynos/mmc.h
@@ -53,6 +53,8 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x)  16)
 #define SDHCI_CTRL4_DRIVE_SHIFT(16)
 
+#define SDHCI_MAX_HOSTS 4
+
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
 static inline int s5p_mmc_init(int index, int bus_width)
@@ -62,4 +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
 
return s5p_sdhci_init(base, index, bus_width);
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_mmc_init(const void *blob);
+#endif
+
 #endif
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 40ff873..ccae4cc 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -8,8 +8,15 @@
 #include common.h
 #include malloc.h
 #include sdhci.h
+#include fdtdec.h
+#include libfdt.h
+#include asm/gpio.h
 #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)
@@ -86,3 +93,125 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 
return add_sdhci(host, 5200, 40);
 }
+
+#ifdef CONFIG_OF_CONTROL
+struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
+
+static int do_sdhci_init(struct sdhci_host *host)
+{
+   int dev_id, flag;
+   int err = 0;
+
+   flag = host-bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
+   dev_id = host-index + PERIPH_ID_SDMMC0;
+
+   if (fdt_gpio_isvalid(host-pwr_gpio)) {
+   gpio_direction_output(host-pwr_gpio.gpio, 1);
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   debug(MMC not configured\n);
+   return err;
+   }
+   }
+
+   if (fdt_gpio_isvalid(host-cd_gpio)) {
+   gpio_direction_output(host-cd_gpio.gpio, 0xf);
+   if (gpio_get_value(host-cd_gpio.gpio))
+   return -ENODEV;
+
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   printf(external SD not configured\n);
+   return err;
+   }
+   }
+
+   host-name = S5P_NAME;
+
+   host-quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
+   SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
+   SDHCI_QUIRK_WAIT_SEND_CMD;
+   host-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
+
+   host-set_control_reg = s5p_sdhci_set_control_reg;
+   host-set_clock = set_mmc_clk;
+
+   host-host_caps = MMC_MODE_HC;
+
+   return add_sdhci(host, 5200, 40);
+}
+
+static int sdhci_get_config(const void *blob, int node, struct sdhci_host 
*host)
+{
+   int bus_width, dev_id;
+   unsigned int base;
+
+   /* Get device id */
+   dev_id = pinmux_decode_periph_id(blob, node);
+   if (dev_id  PERIPH_ID_SDMMC0  dev_id  PERIPH_ID_SDMMC3) {
+   debug(MMC: Can't get device id\n);
+   return -1;
+   }
+   host-index = dev_id - PERIPH_ID_SDMMC0;
+
+   /* Get bus width */
+   bus_width = fdtdec_get_int(blob, node, samsung,bus-width, 0);
+   if (bus_width = 0) {
+   debug(MMC: Can't get bus-width\n);
+   return -1;
+   }
+   host-bus_width = bus_width;
+
+   /* Get the base address from the device node */
+   base = fdtdec_get_addr(blob, node, reg);
+   if (!base) {
+   debug(MMC: Can't get base address\n);
+   return -1;
+   }
+   host-ioaddr = (void *)base;
+
+   fdtdec_decode_gpio(blob, node, pwr-gpios, host-pwr_gpio);
+   fdtdec_decode_gpio(blob, node, cd-gpios, host-cd_gpio);
+
+   return 0;
+}
+
+static int process_nodes(const void *blob, int node_list[], int count)
+{
+   struct sdhci_host *host;
+   int i, node;
+
+   debug(%s: count = %d\n, __func__, count);
+
+   /* build sdhci_host[] for each controller */
+   for (i = 0; i  count; i

[U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function

2014-02-13 Thread Piotr Wilczek
This patch removes currently unused max77686_init function.
Despite being not used, it's implementation is board specific.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - new patch

 board/samsung/common/board.c |  120 --
 1 file changed, 120 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cd873bc..3ac8005 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,7 +22,6 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
-#include power/max77686_pmic.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -160,133 +159,14 @@ static int board_init_cros_ec_devices(const void *blob)
 }
 #endif
 
-#if defined(CONFIG_POWER)
-#ifdef CONFIG_POWER_MAX77686
-static int pmic_reg_update(struct pmic *p, int reg, uint regval)
-{
-   u32 val;
-   int ret = 0;
-
-   ret = pmic_reg_read(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register read failed\n, __func__, reg);
-   return -1;
-   }
-   val |= regval;
-   ret = pmic_reg_write(p, reg, val);
-   if (ret) {
-   debug(%s: PMIC %d register write failed\n, __func__, reg);
-   return -1;
-   }
-   return 0;
-}
-
-static int max77686_init(void)
-{
-   struct pmic *p;
-
-   if (pmic_init(I2C_PMIC))
-   return -1;
-
-   p = pmic_get(MAX77686_PMIC);
-   if (!p)
-   return -ENODEV;
-
-   if (pmic_probe(p))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ, MAX77686_32KHCP_EN))
-   return -1;
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT,
-   MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V))
-   return -1;
-
-   /* VDD_MIF */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT,
-  MAX77686_BUCK1OUT_1V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK1OUT);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL,
-   MAX77686_BUCK1CTRL_EN))
-   return -1;
-
-   /* VDD_ARM */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1,
-  MAX77686_BUCK2DVS1_1_3V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK2DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1,
-   MAX77686_BUCK2CTRL_ON))
-   return -1;
-
-   /* VDD_INT */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1,
-  MAX77686_BUCK3DVS1_1_0125V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK3DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_G3D */
-   if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1,
-  MAX77686_BUCK4DVS1_1_2V)) {
-   debug(%s: PMIC %d register write failed\n, __func__,
- MAX77686_REG_PMIC_BUCK4DVS1);
-   return -1;
-   }
-
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK4CTRL1,
-   MAX77686_BUCK3CTRL_ON))
-   return -1;
-
-   /* VDD_LDO2 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO2CTRL1,
-   MAX77686_LD02CTRL1_1_5V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO3 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO3CTRL1,
-   MAX77686_LD03CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO5 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO5CTRL1,
-   MAX77686_LD05CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   /* VDD_LDO10 */
-   if (pmic_reg_update(p, MAX77686_REG_PMIC_LDO10CTRL1,
-   MAX77686_LD10CTRL1_1_8V | EN_LDO))
-   return -1;
-
-   return 0;
-}
-#endif
-
 int power_init_board(void)
 {
int ret = 0;
 
set_ps_hold_ctrl();
 
-#ifdef CONFIG_POWER_MAX77686
-   ret = max77686_init();
-#endif
-
return ret;
 }
-#endif
 
 #ifdef CONFIG_OF_CONTROL
 static int decode_sromc(const void *blob, struct fdt_sromc *config)
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 06/12] board:samsung: move checkboard to common file

2014-02-13 Thread Piotr Wilczek
The checkboard function's implementation is common for all
DT supporting boards and should be placed in the board common file.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Rajeshwari S Shinde rajeshwar...@samsung.com
Cc: Amar amarendra...@samsung.com
---
Changes for v2:
 - new patch

 board/samsung/common/board.c|   12 
 board/samsung/smdk5250/exynos5-dt.c |   15 ---
 board/samsung/smdk5420/smdk5420.c   |   15 ---
 3 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 3ac8005..99e2fd3 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -257,7 +257,19 @@ int board_mmc_init(bd_t *bis)
return ret;
 }
 #endif
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+   const char *board_name;
+
+   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
+   printf(Board: %s\n, board_name ? board_name : unknown);
+
+   return 0;
+}
 #endif
+#endif /* CONFIG_OF_CONTROL */
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index 5fb8664..b22fba5 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -45,21 +45,6 @@ int exynos_init(void)
return 0;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_LCD
 void exynos_cfg_lcd_gpio(void)
 {
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 3ad2ad0..e4606ec 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -142,18 +142,3 @@ int board_get_revision(void)
 {
return 0;
 }
-
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   const char *board_name;
-
-   board_name = fdt_getprop(gd-fdt_blob, 0, model, NULL);
-   if (board_name == NULL)
-   printf(\nUnknown Board\n);
-   else
-   printf(\nBoard: %s\n, board_name);
-
-   return 0;
-}
-#endif
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 10/12] board:universal: Enable device tree on Universal

2014-02-13 Thread Piotr Wilczek
This patch enables to run Universal board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - no changes;

 board/samsung/dts/exynos4210-universal_c210.dts |   83 +
 board/samsung/universal_c210/universal.c|  204 ++-
 include/configs/s5pc210_universal.h |  145 +---
 3 files changed, 176 insertions(+), 256 deletions(-)
 create mode 100644 board/samsung/dts/exynos4210-universal_c210.dts

diff --git a/board/samsung/dts/exynos4210-universal_c210.dts 
b/board/samsung/dts/exynos4210-universal_c210.dts
new file mode 100644
index 000..1cdd981
--- /dev/null
+++ b/board/samsung/dts/exynos4210-universal_c210.dts
@@ -0,0 +1,83 @@
+/*
+ * Samsung's Exynos4210 based Universal C210 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Universal C210 based on Exynos4210 rev0;
+   compatible = samsung,universal_c210, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 480;
+   samsung,vl-row = 800;
+   samsung,vl-width = 480;
+   samsung,vl-height = 800;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 2;
+   samsung,vl-hbpd = 16;
+   samsung,vl-hfpd = 16;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 8;
+   samsung,vl-vfpd = 8;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,pclk_name = 1;
+   samsung,sclk_div = 1;
+
+   samsung,winid = 0;
+   samsung,power-on-delay = 1;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 0;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+};
diff --git a/board/samsung/universal_c210/universal.c 
b/board/samsung/universal_c210/universal.c
index 96da7e0..82249d3 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -13,16 +13,17 @@
 #include asm/gpio.h
 #include asm/arch/adc.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/watchdog.h
-#include libtizen.h
 #include ld9040.h
 #include power/pmic.h
+#include usb.h
 #include usb/s3c_udc.h
 #include asm/arch/cpu.h
 #include power/max8998_pmic.h
+#include libtizen.h
 #include samsung/misc.h
+#include usb_mass_storage.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,7 +43,7 @@ static int get_hwrev(void)
 
 static void init_pmic_lcd(void);
 
-int power_init_board(void)
+int exynos_power_init(void)
 {
int ret;
 
@@ -59,22 +60,6 @@ int power_init_board(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) +
-   get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
-
-   return 0;
-}
-
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
-}
-
 static unsigned short get_adc_value(int channel)
 {
struct s5p_adc *adc = (struct s5p_adc *)samsung_get_base_adc();
@@ -159,71 +144,6 @@ static void check_hw_revision(void)
board_rev |= hwrev;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   puts(Board:\tUniversal C210\n);
-   return 0;
-}
-#endif
-
-#ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
-{
-   int err;
-
-   switch (get_hwrev()) {
-   case 0

[U-Boot] [PATCH V2 09/12] board:origen: Enable device tree on Origen

2014-02-13 Thread Piotr Wilczek
This patch enables to run Origen board on device tree.

Uart, DRAM and MMC init functions are removed as their
generic replacements form the common board file are used.

The config file is modified to contain only board specific options.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - no changes;

 board/samsung/dts/exynos4210-origen.dts |   45 
 board/samsung/origen/origen.c   |  112 +++--
 include/configs/origen.h|  117 +++
 3 files changed, 94 insertions(+), 180 deletions(-)
 create mode 100644 board/samsung/dts/exynos4210-origen.dts

diff --git a/board/samsung/dts/exynos4210-origen.dts 
b/board/samsung/dts/exynos4210-origen.dts
new file mode 100644
index 000..5c9d2ae
--- /dev/null
+++ b/board/samsung/dts/exynos4210-origen.dts
@@ -0,0 +1,45 @@
+/*
+ * Samsung's Exynos4210 based Origen board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ skeleton.dtsi
+/include/ exynos4.dtsi
+
+/ {
+   model = Insignal Origen evaluation board based on Exynos4210;
+   compatible = insignal,origen, samsung,exynos4210;
+
+   chosen {
+   bootargs =;
+   };
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   status = disabled;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 15f77ca..d502f02 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -11,129 +11,35 @@
 #include asm/arch/mmc.h
 #include asm/arch/periph.h
 #include asm/arch/pinmux.h
+#include usb.h
 
 DECLARE_GLOBAL_DATA_PTR;
-struct exynos4_gpio_part1 *gpio1;
-struct exynos4_gpio_part2 *gpio2;
 
-int board_init(void)
+u32 get_board_rev(void)
 {
-   gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
-   gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
-
-   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
return 0;
 }
 
-static int board_uart_init(void)
+int exynos_init(void)
 {
-   int err;
-
-   err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART0 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART1 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART2 not configured\n);
-   return err;
-   }
-
-   err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
-   if (err) {
-   debug(UART3 not configured\n);
-   return err;
-   }
-
return 0;
 }
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
-{
-   int err;
-   err = board_uart_init();
-   if (err) {
-   debug(UART init failed\n);
-   return err;
-   }
-   return err;
-}
-#endif
-
-int dram_init(void)
+int board_usb_init(int index, enum usb_init_type init)
 {
-   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
-
return 0;
 }
 
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \
-   PHYS_SDRAM_1_SIZE);
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, \
-   PHYS_SDRAM_2_SIZE);
-   gd-bd-bi_dram[2].start = PHYS_SDRAM_3;
-   gd-bd-bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3, \
-   PHYS_SDRAM_3_SIZE);
-   gd-bd-bi_dram[3].start = PHYS_SDRAM_4;
-   gd-bd-bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4

[U-Boot] [PATCH V2 08/12] arm:exynos: enble sdhci and misc_init to common board

2014-02-13 Thread Piotr Wilczek
This patch enables sdhci initialistion and misc_init_r in common board
file for all exynos 4 based boards.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - new patch;

 board/samsung/common/board.c |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 75515d7..f21a6ce 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -22,6 +22,8 @@
 #include asm/arch/power.h
 #include power/pmic.h
 #include asm/arch/sromc.h
+#include lcd.h
+#include samsung/misc.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -181,6 +183,7 @@ int power_init_board(void)
 }
 
 #ifdef CONFIG_OF_CONTROL
+#ifdef CONFIG_SMC911X
 static int decode_sromc(const void *blob, struct fdt_sromc *config)
 {
int err;
@@ -204,6 +207,7 @@ static int decode_sromc(const void *blob, struct fdt_sromc 
*config)
}
return 0;
 }
+#endif
 
 int board_eth_init(bd_t *bis)
 {
@@ -261,10 +265,18 @@ int board_mmc_init(bd_t *bis)
 {
int ret;
 
+#ifdef CONFIG_SDHCI
+   /* mmc initializattion for available channels */
+   ret = exynos_mmc_init(gd-fdt_blob);
+   if (ret)
+   debug(mmc init failed\n);
+#endif
+#ifdef CONFIG_DWMMC
/* dwmmc initializattion for available channels */
ret = exynos_dwmmc_init(gd-fdt_blob);
if (ret)
debug(dwmmc init failed\n);
+#endif
 
return ret;
 }
@@ -313,3 +325,21 @@ int arch_early_init_r(void)
 
return 0;
 }
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
+#ifdef CONFIG_LCD_MENU
+   keys_init();
+   check_boot_mode();
+#endif
+#ifdef CONFIG_CMD_BMP
+   if (panel_info.logo_on)
+   draw_logo();
+#endif
+   return 0;
+}
+#endif
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 11/12] board:trats: Enable device tree on Trats

2014-02-13 Thread Piotr Wilczek
This patch enables to run Trats board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
CC: Lukasz Majewski l.majew...@samsung.com
---
Changes for v2:
 - no changes;

 board/samsung/dts/exynos4210-trats.dts |  120 ++
 board/samsung/trats/trats.c|  213 ++--
 include/configs/trats.h|  192 +++-
 3 files changed, 172 insertions(+), 353 deletions(-)
 create mode 100644 board/samsung/dts/exynos4210-trats.dts

diff --git a/board/samsung/dts/exynos4210-trats.dts 
b/board/samsung/dts/exynos4210-trats.dts
new file mode 100644
index 000..79fdad2
--- /dev/null
+++ b/board/samsung/dts/exynos4210-trats.dts
@@ -0,0 +1,120 @@
+/*
+ * Samsung's Exynos4210 based Trats board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats based on Exynos4210;
+   compatible = samsung,trats, samsung,exynos4210;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 720;
+   samsung,vl-row = 1280;
+   samsung,vl-width = 720;
+   samsung,vl-height = 1280;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 5;
+   samsung,vl-hbpd = 10;
+   samsung,vl-hfpd = 10;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 1;
+   samsung,vl-vfpd = 13;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,winid = 3;
+   samsung,power-on-delay = 30;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 1;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+
+   mipidsi@11c8 {
+   compatible = samsung,exynos-mipi-dsi;
+   reg = 0x11c8 0x5c;
+
+   samsung,dsim-config-e_interface = 1;
+   samsung,dsim-config-e_virtual_ch = 0;
+   samsung,dsim-config-e_pixel_format = 7;
+   samsung,dsim-config-e_burst_mode = 1;
+   samsung,dsim-config-e_no_data_lane = 3;
+   samsung,dsim-config-e_byte_clk = 0;
+   samsung,dsim-config-hfp = 1;
+
+   samsung,dsim-config-p = 3;
+   samsung,dsim-config-m = 120;
+   samsung,dsim-config-s = 1;
+
+   samsung,dsim-config-pll_stable_time = 500;
+   samsung,dsim-config-esc_clk = 2000;
+   samsung,dsim-config-stop_holding_cnt = 0x7ff;
+   samsung,dsim-config-bta_timeout = 0xff;
+   samsung,dsim-config-rx_timeout = 0x;
+
+   samsung,dsim-device-id = 0x;
+   samsung,dsim-device-bus_id = 0;
+
+   samsung,dsim-device-reverse_panel = 1;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index b725505..0f78ec0 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -12,23 +12,20 @@
 #include asm/io.h
 #include asm/arch/cpu.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/clock.h
-#include asm/arch/clk.h
 #include asm/arch/mipi_dsim.h
 #include asm/arch/watchdog.h
 #include asm/arch

[U-Boot] [PATCH V2 12/12] board:trats2: Enable device tree on Trats2

2014-02-13 Thread Piotr Wilczek
This patch enables to run Trats2 board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - fixed mmc2 addres in DT;

 board/samsung/dts/exynos4412-trats2.dts |  434 +++
 board/samsung/trats2/trats2.c   |  233 +
 include/configs/trats2.h|  198 +++---
 3 files changed, 474 insertions(+), 391 deletions(-)
 create mode 100644 board/samsung/dts/exynos4412-trats2.dts

diff --git a/board/samsung/dts/exynos4412-trats2.dts 
b/board/samsung/dts/exynos4412-trats2.dts
new file mode 100644
index 000..d31e780
--- /dev/null
+++ b/board/samsung/dts/exynos4412-trats2.dts
@@ -0,0 +1,434 @@
+/*
+ * Samsung's Exynos4412 based Trats2 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats2 based on Exynos4412;
+   compatible = samsung,trats2, samsung,exynos4412;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   i2c@138d {
+   samsung,i2c-sda-delay = 100;
+   samsung,i2c-slave-addr = 0x10;
+   samsung,i2c-max-bus-freq = 10;
+   status = okay;
+
+   max77686_pmic@09 {
+   compatible = maxim,max77686_pmic;
+   interrupts = 7 0;
+   reg = 0x09 0 0;
+   #clock-cells = 1;
+
+   voltage-regulators {
+   ldo1_reg: ldo1 {
+   regulator-compatible = LDO1;
+   regulator-name = VALIVE_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo2_reg: ldo2 {
+   regulator-compatible = LDO2;
+   regulator-name = VM1M2_1.2V_AP;
+   regulator-min-microvolt = 120;
+   regulator-max-microvolt = 120;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo3_reg: ldo3 {
+   regulator-compatible = LDO3;
+   regulator-name = VCC_1.8V_AP;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo4_reg: ldo4 {
+   regulator-compatible = LDO4;
+   regulator-name = VCC_2.8V_AP;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo5_reg: ldo5 {
+   regulator-compatible = LDO5;
+   regulator-name = VCC_1.8V_IO;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo6_reg: ldo6 {
+   regulator-compatible = LDO6;
+   regulator-name = VMPLL_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max

[U-Boot] [PATCH V2 07/12] arm:exynos: add common DTS file for exynos 4

2014-02-13 Thread Piotr Wilczek
This patch adds common dtsi file and config header for all
Exynos 4 based boards.

Patch additionally adds board specific (weak) functions for
board_early_init_f and board_power_init functions.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
Changes for v2:
 - reuse existing common board.c file

 arch/arm/dts/exynos4.dtsi|  139 
 arch/arm/include/asm/arch-exynos/board.h |   12 +++
 board/samsung/common/board.c |   20 -
 include/configs/exynos4-dt.h |  144 ++
 4 files changed, 311 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 include/configs/exynos4-dt.h

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
new file mode 100644
index 000..38a6919
--- /dev/null
+++ b/arch/arm/dts/exynos4.dtsi
@@ -0,0 +1,139 @@
+/*
+ * Samsung's Exynos4 SoC common device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/include/ skeleton.dtsi
+
+/ {
+
+   serial@1380 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1380 0x3c;
+   id = 0;
+   };
+
+   serial@1381 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1381 0x3c;
+   id = 1;
+   };
+
+   serial@1382 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1382 0x3c;
+   id = 2;
+   };
+
+   serial@1383 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1383 0x3c;
+   id = 3;
+   };
+
+   serial@1384 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1384 0x3c;
+   id = 4;
+   };
+
+   i2c@1386 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 0 0 0;
+   };
+
+   i2c@1387 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 1 1 0;
+   };
+
+   i2c@1388 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 2 2 0;
+   };
+
+   i2c@1389 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 3 3 0;
+   };
+
+   i2c@138a {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 4 4 0;
+   };
+
+   i2c@138b {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 5 5 0;
+   };
+
+   i2c@138c {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 6 6 0;
+   };
+
+   i2c@138d {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 7 7 0;
+   };
+
+   sdhci@1251 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1251 0x1000;
+   interrupts = 0 75 0;
+   };
+
+   sdhci@1252 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1252 0x1000;
+   interrupts = 0 76 0;
+   };
+
+   sdhci@1253 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1253 0x1000;
+   interrupts = 0 77 0;
+   };
+
+   sdhci@1254 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1254 0x1000;
+   interrupts = 0 78 0;
+   };
+
+   gpio: gpio {
+   gpio-controller;
+   #gpio-cells = 2;
+
+   interrupt-controller;
+   #interrupt-cells = 2;
+   };
+};
diff --git a/arch/arm/include/asm/arch-exynos/board.h 
b/arch/arm/include/asm/arch-exynos/board.h
index 243fb12..1b1cd0d 100644
--- a/arch/arm/include/asm/arch-exynos/board.h
+++ b/arch/arm/include/asm/arch-exynos/board.h
@@ -14,4 +14,16 @@
  */
 int exynos_init(void);
 
+/*
+ * Exynos board specific changes for
+ * board_early_init_f
+ */
+int

Re: [U-Boot] [PATCH 5/9] arm:exynos: add common board file for exynos 4

2014-02-10 Thread Piotr Wilczek

 -Original Message-
 From: Minkyu Kang [mailto:mk7.k...@samsung.com]
 Sent: Friday, February 07, 2014 10:48 AM
 To: Piotr Wilczek
 Cc: u-boot@lists.denx.de; 'Kyungmin Park'; Lukasz Majewski; 'Jaehoon
 Chung'; 'Inha Song'; 'Chanho Park'
 Subject: Re: [PATCH 5/9] arm:exynos: add common board file for exynos 4
 
 On 07/02/14 17:40, Piotr Wilczek wrote:
  Dear Minkyu Kang,
 
  -Original Message-
  From: Minkyu Kang [mailto:mk7.k...@samsung.com]
  Sent: Friday, February 07, 2014 8:53 AM
  To: Piotr Wilczek
  Cc: u-boot@lists.denx.de; Kyungmin Park; Lukasz Majewski; Jaehoon
  Chung; Inha Song; Chanho Park
  Subject: Re: [PATCH 5/9] arm:exynos: add common board file for
 exynos
  4
 
  On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch adds common board file for Exynos 4 based boards.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   arch/arm/dts/exynos4.dtsi|  139
  +++
   board/samsung/common/Makefile|1 +
   board/samsung/common/board_exynos4.c |   83 +
   include/configs/exynos4-dt.h |  170
  ++
   4 files changed, 393 insertions(+)
   create mode 100644 arch/arm/dts/exynos4.dtsi  create mode 100644
  board/samsung/common/board_exynos4.c
   create mode 100644 include/configs/exynos4-dt.h
 
  diff --git a/board/samsung/common/Makefile
  b/board/samsung/common/Makefile index 7d2bb8c..25f1e40 100644
  --- a/board/samsung/common/Makefile
  +++ b/board/samsung/common/Makefile
  @@ -12,4 +12,5 @@ obj-$(CONFIG_MISC_COMMON) += misc.o
 
   ifndef CONFIG_SPL_BUILD
   obj-$(CONFIG_BOARD_COMMON)   += board.o
  +obj-$(CONFIG_BOARD_COMMON_EXYNOS4)   += board_exynos4.o
   endif
  diff --git a/board/samsung/common/board_exynos4.c
  b/board/samsung/common/board_exynos4.c
  new file mode 100644
  index 000..2d313e6
  --- /dev/null
  +++ b/board/samsung/common/board_exynos4.c
 
  I don't understand why need exynos4 common board file.
  There's already exist board.c that is common board file for samsung.
 
  Because in the board.c file, both common and board specific functions
  are added.
  Max 77686, eth, power, board late initialization functions are board
  specific.
  If they are removed, I will be able to use the board.c file.
 
 It seems to be wrapped with ifdef.
 I think there's no problems to use same file.
 
Max77686 init implementation is different for Trats2 and ifdef will not help
here.
I think that max77686_init() function should be removed from the board.c
file.

Other board specific initializations I can resolve in the way it was done in
board_init() function, if that's the preferred way.

 Thanks,
 Minkyu Kang.

Best regrds,
Piotr Wilczek



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


Re: [U-Boot] [PATCH 3/9] video:exynos_fb:fdt: add additional fdt data

2014-02-07 Thread Piotr Wilczek
Dear Minkyu Kang,

 On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch adds additional data parsing from DTB.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
   drivers/video/exynos_fb.c |   19 +++
   1 file changed, 19 insertions(+)
 
  diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
  index d4863e8..7e0099f 100644
  --- a/drivers/video/exynos_fb.c
  +++ b/drivers/video/exynos_fb.c
  @@ -20,6 +20,7 @@
   #include asm/arch/dp_info.h
   #include asm/arch/system.h
   #include asm-generic/errno.h
  +#include libtizen.h
 
   #include exynos_fb.h
 
  @@ -269,6 +270,21 @@ int exynos_fimd_parse_dt(const void *blob)
  panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
  samsung,dual-lcd-enabled,
0);
 
  +   panel_info.logo_on = fdtdec_get_int(blob, node,
  +   samsung,logo-on, 0);
 
 duplicated.
Ok, will remove it.

 
  +
  +   panel_info.resolution = fdtdec_get_int(blob, node,
  +   samsung,resolution, 0);
  +
  +   panel_info.rgb_mode = fdtdec_get_int(blob, node,
  +   samsung,rgb-mode, 0);
  +
  +   panel_info.power_on_delay = fdtdec_get_int(blob, node,
  +   samsung,power-on-delay,
0);
  +
  +#ifdef CONFIG_TIZEN
  +   get_tizen_logo_info(panel_info);
 
 It looks strange.
 Why you load the logo at frame buffer driver?
Ok, I will move it.

 
  +#endif
  return 0;
   }
   #endif
  @@ -281,6 +297,9 @@ void lcd_ctrl_init(void *lcdbase)  #ifdef
  CONFIG_OF_CONTROL
  if (exynos_fimd_parse_dt(gd-fdt_blob))
  debug(Can't get proper panel info\n);
  +#ifdef CONFIG_EXYNOS_MIPI_DSIM
  +   exynos_init_dsim_platform_data(panel_info);
  +#endif
   #else
  /* initialize parameters which is specific to panel. */
  init_panel_info(panel_info);
 
 
 Thanks,
 Minkyu Kang.

Thanks for review.
Piotr Wilczek



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


Re: [U-Boot] [PATCH 5/9] arm:exynos: add common board file for exynos 4

2014-02-07 Thread Piotr Wilczek
Dear Minkyu Kang,

 -Original Message-
 From: Minkyu Kang [mailto:mk7.k...@samsung.com]
 Sent: Friday, February 07, 2014 8:53 AM
 To: Piotr Wilczek
 Cc: u-boot@lists.denx.de; Kyungmin Park; Lukasz Majewski; Jaehoon
 Chung; Inha Song; Chanho Park
 Subject: Re: [PATCH 5/9] arm:exynos: add common board file for exynos 4
 
 On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch adds common board file for Exynos 4 based boards.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   arch/arm/dts/exynos4.dtsi|  139
 +++
   board/samsung/common/Makefile|1 +
   board/samsung/common/board_exynos4.c |   83 +
   include/configs/exynos4-dt.h |  170
 ++
   4 files changed, 393 insertions(+)
   create mode 100644 arch/arm/dts/exynos4.dtsi  create mode 100644
  board/samsung/common/board_exynos4.c
   create mode 100644 include/configs/exynos4-dt.h
 
  diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
 new
  file mode 100644 index 000..38a6919
  --- /dev/null
  +++ b/arch/arm/dts/exynos4.dtsi
  @@ -0,0 +1,139 @@
  +/*
  + * Samsung's Exynos4 SoC common device tree source
  + *
  + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  + * http://www.samsung.com
  + *
  + * SPDX-License-Identifier:GPL-2.0+
  + */
  +
  +/include/ skeleton.dtsi
  +
  +/ {
  +
  +   serial@1380 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1380 0x3c;
  +   id = 0;
  +   };
  +
  +   serial@1381 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1381 0x3c;
  +   id = 1;
  +   };
  +
  +   serial@1382 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1382 0x3c;
  +   id = 2;
  +   };
  +
  +   serial@1383 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1383 0x3c;
  +   id = 3;
  +   };
  +
  +   serial@1384 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1384 0x3c;
  +   id = 4;
  +   };
  +
  +   i2c@1386 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 0 0 0;
  +   };
  +
  +   i2c@1387 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 1 1 0;
  +   };
  +
  +   i2c@1388 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 2 2 0;
  +   };
  +
  +   i2c@1389 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 3 3 0;
  +   };
  +
  +   i2c@138a {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 4 4 0;
  +   };
  +
  +   i2c@138b {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 5 5 0;
  +   };
  +
  +   i2c@138c {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 6 6 0;
  +   };
  +
  +   i2c@138d {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 7 7 0;
  +   };
  +
  +   sdhci@1251 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1251 0x1000;
  +   interrupts = 0 75 0;
  +   };
  +
  +   sdhci@1252 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1252 0x1000;
  +   interrupts = 0 76 0;
  +   };
  +
  +   sdhci@1253 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1253 0x1000;
  +   interrupts = 0 77 0;
  +   };
  +
  +   sdhci@1254 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1254 0x1000;
  +   interrupts = 0 78 0;
  +   };
  +
  +   gpio: gpio {
  +   gpio-controller;
  +   #gpio-cells = 2;
  +
  +   interrupt-controller;
  +   #interrupt-cells = 2;
  +   };
  +};
  diff --git a/board/samsung/common/Makefile
  b/board/samsung/common/Makefile index 7d2bb8c..25f1e40 100644
  --- a/board/samsung/common/Makefile
  +++ b/board/samsung/common/Makefile
  @@ -12,4 +12,5 @@ obj-$(CONFIG_MISC_COMMON) += misc.o
 
   ifndef CONFIG_SPL_BUILD
   obj

Re: [U-Boot] [PATCH 2/9] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-02-07 Thread Piotr Wilczek
Dear Minkyu Kang,

 -Original Message-
 
 On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch enables parsing mipi data from device tree.
  Non device tree case is still supported.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
   arch/arm/include/asm/arch-exynos/mipi_dsim.h |3 +
   drivers/video/exynos_mipi_dsi.c  |   98
 ++
   include/fdtdec.h |1 +
   lib/fdtdec.c |1 +
   4 files changed, 103 insertions(+)
 
  diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  index 40aca71..c9e8e06 100644
  --- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  +++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  @@ -12,6 +12,7 @@
 
   #include linux/list.h
   #include linux/fb.h
  +#include lcd.h
 
   #define PANEL_NAME_SIZE(32)
 
  @@ -368,8 +369,10 @@ int exynos_mipi_dsi_register_lcd_device(struct
 mipi_dsim_lcd_device
  *lcd_dev);
 
   void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim
  *pd);
  +void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
   /* panel driver init based on mipi dsi interface */  void
  s6e8ax0_init(void);
 
  +extern int mipi_power(void);
   #endif /* _DSIM_H */
  diff --git a/drivers/video/exynos_mipi_dsi.c
  b/drivers/video/exynos_mipi_dsi.c index 8bb8fea..ab15ad6 100644
  --- a/drivers/video/exynos_mipi_dsi.c
  +++ b/drivers/video/exynos_mipi_dsi.c
  @@ -9,6 +9,8 @@
 
   #include common.h
   #include malloc.h
  +#include fdtdec.h
  +#include libfdt.h
   #include linux/err.h
   #include asm/arch/dsim.h
   #include asm/arch/mipi_dsim.h
  @@ -22,7 +24,12 @@
   #define master_to_driver(a)(a-dsim_lcd_drv)
   #define master_to_device(a)(a-dsim_lcd_dev)
 
  +DECLARE_GLOBAL_DATA_PTR;
  +
   static struct exynos_platform_mipi_dsim *dsim_pd;
  +static struct mipi_dsim_config dsim_config_dt; static struct
  +exynos_platform_mipi_dsim dsim_platform_data_dt; static struct
  +mipi_dsim_lcd_device mipi_lcd_device_dt;
 
   struct mipi_dsim_ddi {
  int bus_id;
  @@ -238,3 +245,94 @@ void exynos_set_dsim_platform_data(struct
  exynos_platform_mipi_dsim *pd)
 
  dsim_pd = pd;
   }
  +
  +#ifdef CONFIG_OF_CONTROL
  +int exynos_dsim_config_parse_dt(const void *blob) {
  +   int node;
  +
  +   node = fdtdec_next_compatible(blob, 0,
 COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
  +   if (node = 0) {
  +   printf(exynos_mipi_dsi: Can't get device node for mipi
 dsi\n);
  +   return -ENODEV;
  +   }
  +
  +   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_interface, 0);
  +
  +   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_virtual_ch, 0);
  +
  +   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_pixel_format, 0);
  +
  +   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_burst_mode, 0);
  +
  +   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_no_data_lane, 0);
  +
  +   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_byte_clk, 0);
  +
  +   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-hfp, 0);
  +
  +   dsim_config_dt.p = fdtdec_get_int(blob, node,
  + samsung,dsim-config-p, 0);
  +   dsim_config_dt.m = fdtdec_get_int(blob, node,
  + samsung,dsim-config-m, 0);
  +   dsim_config_dt.s = fdtdec_get_int(blob, node,
  + samsung,dsim-config-s, 0);
  +
  +   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-pll_stable_time, 0);
  +
  +   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-esc_clk, 0);
  +
  +   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-stop_holding_cnt, 0);
  +
  +   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-bta_timeout, 0);
  +
  +   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-rx_timeout, 0);
  +
  +   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
  +   samsung,dsim-device-name);
  +
  +   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node,
  +   samsung,dsim-device-id, 0);
  +
  +   mipi_lcd_device_dt.bus_id

Re: [U-Boot] [PATCH 1/9] exynos4:pinmux:fdt: decode peripheral id

2014-01-28 Thread Piotr Wilczek
Hi Jaehoon,

Thanks for review. Please comments below.

 -Original Message-
 
 Hi, Piotr.
 
 On 01/27/2014 11:15 PM, Piotr Wilczek wrote:
  This patch adds api to decode peripheral id based in interrupt
 number.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  CC: Minkyu Kang mk7.k...@samsung.com
  ---
   arch/arm/cpu/armv7/exynos/pinmux.c |   21 +
   1 file changed, 21 insertions(+)
 
  diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c
  b/arch/arm/cpu/armv7/exynos/pinmux.c
  index 904177a..3201d53 100644
  --- a/arch/arm/cpu/armv7/exynos/pinmux.c
  +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
  @@ -741,6 +741,25 @@ int exynos_pinmux_config(int peripheral, int
  flags)  }
 
   #ifdef CONFIG_OF_CONTROL
  +
 
 Remove the white space.
Ok.

 
  +static int exynos4_pinmux_decode_periph_id(const void *blob, int
  +node) {
  +   int err;
  +   u32 cell[3];
  +
  +   err = fdtdec_get_int_array(blob, node, interrupts, cell,
  +   ARRAY_SIZE(cell));
  +   if (err)
  +   return PERIPH_ID_NONE;
  +
  +   /* check for invalid peripheral id */
  +   if ((PERIPH_ID_SDMMC4  cell[1]) || (cell[1]  PERIPH_ID_UART0))
 
 What's condition checking? i didn't understand this.
 PERIPH_ID_SDMMC  cell[1] or PERIPH_ID_UART0  cell[1] is valid?
 
It supposed to check if cell[1] is within supported periph_id range and
should be like this:
If ((cell[1] = PERIPH_ID_UART0)  (cell[1]  PERIPH_ID_COUNT))

 Best Regards,
 Jaehoon Chung
 
  +   return cell[1];
  +
  +   debug( invalid peripheral id\n);
  +   return PERIPH_ID_NONE;
  +}
  +
   static int exynos5_pinmux_decode_periph_id(const void *blob, int
  node)  {
  int err;
  @@ -763,6 +782,8 @@ int pinmux_decode_periph_id(const void *blob, int
  node)  {
  if (cpu_is_exynos5())
  return  exynos5_pinmux_decode_periph_id(blob, node);
  +   else if (cpu_is_exynos4())
  +   return  exynos4_pinmux_decode_periph_id(blob, node);
  else
  return PERIPH_ID_NONE;
   }
 
Best regards,
Piotr Wilczek



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


Re: [U-Boot] [PATCH 4/9] drivers:mmc:sdhci: enable support for DT

2014-01-28 Thread Piotr Wilczek
Hi Jaehoon,

 Hi, Piotr.
 
 On 01/27/2014 11:15 PM, Piotr Wilczek wrote:
  This patch enables support for device tree for sdhci driver.
  Non DT case is still supported.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
   arch/arm/include/asm/arch-exynos/mmc.h |7 ++
   drivers/mmc/s5p_sdhci.c|  130
 +++-
   include/fdtdec.h   |1 +
   include/sdhci.h|5 ++
   lib/fdtdec.c   |1 +
   5 files changed, 143 insertions(+), 1 deletion(-)
 
  diff --git a/arch/arm/include/asm/arch-exynos/mmc.h
  b/arch/arm/include/asm/arch-exynos/mmc.h
  index 98d6530..0fb6461 100644
  --- a/arch/arm/include/asm/arch-exynos/mmc.h
  +++ b/arch/arm/include/asm/arch-exynos/mmc.h
  @@ -53,6 +53,8 @@
   #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x)  16)
   #define SDHCI_CTRL4_DRIVE_SHIFT(16)
 
  +#define SDHCI_MAX_HOSTS 4
  +
   int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
   static inline int s5p_mmc_init(int index, int bus_width) @@ -62,4
  +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
 
  return s5p_sdhci_init(base, index, bus_width);  }
  +
  +#ifdef CONFIG_OF_CONTROL
  +int exynos_mmc_init(const void *blob); #endif
  +
   #endif
  diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index
  40ff873..7456ee0 100644
  --- a/drivers/mmc/s5p_sdhci.c
  +++ b/drivers/mmc/s5p_sdhci.c
  @@ -8,9 +8,15 @@
   #include common.h
   #include malloc.h
   #include sdhci.h
  +#include fdtdec.h
  +#include libfdt.h
  +#include asm/gpio.h
   #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)  { @@ -86,3
 +92,125
  @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 
  return add_sdhci(host, 5200, 40);  }
  +
  +#ifdef CONFIG_OF_CONTROL
  +struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
  +
  +static int do_sdhci_init(struct sdhci_host *host) {
  +   int dev_id, flag;
  +   int err = 0;
  +
  +   flag = host-bus_width == 8 ? PINMUX_FLAG_8BIT_MODE :
 PINMUX_FLAG_NONE;
  +   dev_id = host-index + PERIPH_ID_SDMMC0;
  +
  +   if (fdt_gpio_isvalid(host-pwr_gpio)) {
  +   gpio_direction_output(host-pwr_gpio.gpio, 1);
 
 what's pwr_gpio? Is it used for the both(eMMC and SD card)?
pwr_gpio is used only for eMMC.
cd_gpio is used for SD Card.

 
  +   err = exynos_pinmux_config(dev_id, flag);
  +   if (err) {
  +   debug(MMC not configured\n);
  +   return err;
  +   }
  +   }
  +
  +   if (fdt_gpio_isvalid(host-cd_gpio)) {
  +   gpio_direction_output(host-cd_gpio.gpio, 0xf);
  +   if (gpio_get_value(host-cd_gpio.gpio))
  +   return -ENODEV;
  +
  +   err = exynos_pinmux_config(dev_id, flag);
  +   if (err) {
  +   printf(external SD not configured\n);
  +   return err;
  +   }
  +   }
  +
  +   host-name = S5P_NAME;
  +
  +   host-quirks = SDHCI_QUIRK_NO_HISPD_BIT |
 SDHCI_QUIRK_BROKEN_VOLTAGE |
  +   SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
  +   SDHCI_QUIRK_WAIT_SEND_CMD;
  +   host-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
  +   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
  +
  +   host-set_control_reg = s5p_sdhci_set_control_reg;
  +   host-set_clock = set_mmc_clk;
  +
  +   host-host_caps = MMC_MODE_HC;
  +
  +   return add_sdhci(host, 5200, 40); }
  +
  +static int sdhci_get_config(const void *blob, int node, struct
  +sdhci_host *host) {
  +   int bus_width, dev_id;
  +   unsigned int base;
  +
  +   /* Get device id */
  +   dev_id = pinmux_decode_periph_id(blob, node);
  +   if (dev_id  PERIPH_ID_SDMMC0) {
 
 Didn't need to check other boundary?
Yes, I should check for the PERIPH_ID_SDMMC3

 
  +   debug(MMC: Can't get device id\n);
  +   return -1;
  +   }
  +   host-index = dev_id - PERIPH_ID_SDMMC0;
  +
  +   /* Get bus width */
  +   bus_width = fdtdec_get_int(blob, node, samsung,bus-width, 0);
  +   if (bus_width = 0) {
  +   debug(MMC: Can't get bus-width\n);
  +   return -1;
  +   }
  +   host-bus_width = bus_width;
  +
  +   /* Get the base address from the device node */
  +   base = fdtdec_get_addr(blob, node, reg);
  +   if (!base) {
  +   debug(DWMMC: Can't get base address\n);
 
 DWMMC?
MMC

 
  +   return -1;
  +   }
  +   host-ioaddr = (void *)base;
  +
  +   fdtdec_decode_gpio(blob, node, pwr-gpios, host-pwr_gpio);
  +   fdtdec_decode_gpio(blob, node, cd-gpios, host-cd_gpio);
  +
  +   return 0;
  +}
  +
  +static int process_nodes(const void *blob, int node_list[], int

Re: [U-Boot] [PATCH 9/9] board:trats2:fdt: Enable device tree on Trats2

2014-01-28 Thread Piotr Wilczek
Hi Jaehoon,

 On 01/27/2014 11:15 PM, Piotr Wilczek wrote:
  This patch enables to run Trats2 board on device tree.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  CC: Minkyu Kang mk7.k...@samsung.com
  ---
   board/samsung/dts/exynos4412-trats2.dts |  434
 +++
   board/samsung/trats2/trats2.c   |  216 +--
   include/configs/trats2.h|  199 ++
   3 files changed, 459 insertions(+), 390 deletions(-)  create mode
  100644 board/samsung/dts/exynos4412-trats2.dts
 
  diff --git a/board/samsung/dts/exynos4412-trats2.dts
  b/board/samsung/dts/exynos4412-trats2.dts
  new file mode 100644
  index 000..c8f847c
  --- /dev/null
  +++ b/board/samsung/dts/exynos4412-trats2.dts
  @@ -0,0 +1,434 @@
  +/*
  + * Samsung's Exynos4412 based Trats2 board device tree source
  + *
  + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  + * http://www.samsung.com
  + *
  + * SPDX-License-Identifier:GPL-2.0+
  + */
  +
  +/dts-v1/;
  +/include/ exynos4.dtsi
  +
  +/ {
  +   model = Samsung Trats2 based on Exynos4412;
  +   compatible = samsung,trats2, samsung,exynos4412;
  +
  +   config {
  +   samsung,dsim-device-name = s6e8ax0;
  +   };
  +
  +   aliases {
  +   i2c0 = /i2c@1386;
  +   i2c1 = /i2c@1387;
  +   i2c2 = /i2c@1388;
  +   i2c3 = /i2c@1389;
  +   i2c4 = /i2c@138a;
  +   i2c5 = /i2c@138b;
  +   i2c6 = /i2c@138c;
  +   i2c7 = /i2c@138d;
  +   serial0 = /serial@1380;
  +   console = /serial@1382;
  +   mmc0 = sdhci@1251;
  +   mmc2 = sdhci@1251;
 
 mmc2 isn't 0x1251.
It is 0x1253, thanks.

Best regards,
Piotr Wilczek



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


[U-Boot] [PATCH V2] disk:efi: avoid unaligned access on efi partition

2014-01-28 Thread Piotr Wilczek
This patch fixes part_efi code to avoid unaligned access exception
on some ARM platforms.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Tom Rini tr...@ti.com
CC: Albert ARIBAUD albert.u.b...@aribaud.net
---
Chnages for V2:
 - used put_unaligned to copy value;
 - use __aligned to align local array;

 disk/part_efi.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 9c33ae7..eb2cd57 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -225,7 +225,7 @@ static int set_protective_mbr(block_dev_desc_t *dev_desc)
p_mbr-signature = MSDOS_MBR_SIGNATURE;
p_mbr-partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT;
p_mbr-partition_record[0].start_sect = 1;
-   p_mbr-partition_record[0].nr_sects = (u32) dev_desc-lba;
+   put_unaligned(dev_desc-lba, p_mbr-partition_record[0].nr_sects);
 
/* Write MBR sector to the MMC device */
if (dev_desc-block_write(dev_desc-dev, 0, 1, p_mbr) != 1) {
@@ -361,6 +361,8 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
 #ifdef CONFIG_PARTITION_UUIDS
char *str_uuid;
 #endif
+   static efi_guid_t basic_guid __aligned(0x04) =
+   PARTITION_BASIC_DATA_GUID;
 
for (i = 0; i  parts; i++) {
/* partition starting lba */
@@ -388,8 +390,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
gpt_e[i].ending_lba = cpu_to_le64(offset - 1);
 
/* partition type GUID */
-   memcpy(gpt_e[i].partition_type_guid.b,
-   PARTITION_BASIC_DATA_GUID, 16);
+   gpt_e[i].partition_type_guid = basic_guid;
 
 #ifdef CONFIG_PARTITION_UUIDS
str_uuid = partitions[i].uuid;
-- 
1.7.9.5

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


[U-Boot] [PATCH 0/9] Exynos4: add support for device tree

2014-01-27 Thread Piotr Wilczek
This patch set enables support for device tree on all Exynos4 based boards.

DT support is enabled on Exynos mipi dsim and sdhci drives.
Common board_exynos4.c file is created for all functions common for
Exynos4 boards. Origen, Universal, Trats and Trats2 boards are modifed
to support device tree.

This patch set is based on patchset:
[PATCH V2 0/8] arm: add runtime envs describing build
http://patchwork.ozlabs.org/patch/313277/
...
http://patchwork.ozlabs.org/patch/313271/

Piotr Wilczek (9):
  exynos4:pinmux:fdt: decode peripheral id
  video:mipidsim:fdt: Add DT support for mipi dsim driver
  video:exynos_fb:fdt: add additional fdt data
  drivers:mmc:sdhci: enable support for DT
  arm:exynos: add common board file for exynos 4
  board:origen:fdt: Enable device tree on Origen
  board:universal:fdt: Enable device tree on Universal
  trats:fdt: Enable device tree on Trats
  board:trats2:fdt: Enable device tree on Trats2

 arch/arm/cpu/armv7/exynos/pinmux.c  |   21 ++
 arch/arm/dts/exynos4.dtsi   |  139 
 arch/arm/include/asm/arch-exynos/mipi_dsim.h|3 +
 arch/arm/include/asm/arch-exynos/mmc.h  |7 +
 board/samsung/common/Makefile   |1 +
 board/samsung/common/board_exynos4.c|   83 +
 board/samsung/dts/exynos4210-origen.dts |   45 +++
 board/samsung/dts/exynos4210-trats.dts  |  120 +++
 board/samsung/dts/exynos4210-universal_c210.dts |   83 +
 board/samsung/dts/exynos4412-trats2.dts |  434 +++
 board/samsung/origen/origen.c   |   86 +
 board/samsung/trats/trats.c |  176 +
 board/samsung/trats2/trats2.c   |  216 +--
 board/samsung/universal_c210/universal.c|  178 +++---
 drivers/mmc/s5p_sdhci.c |  130 ++-
 drivers/video/exynos_fb.c   |   19 +
 drivers/video/exynos_mipi_dsi.c |   98 +
 include/configs/exynos4-dt.h|  170 +
 include/configs/origen.h|  103 ++
 include/configs/s5pc210_universal.h |  128 +--
 include/configs/trats.h |  177 ++---
 include/configs/trats2.h|  199 +--
 include/fdtdec.h|2 +
 include/sdhci.h |5 +
 lib/fdtdec.c|2 +
 25 files changed, 1511 insertions(+), 1114 deletions(-)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 board/samsung/common/board_exynos4.c
 create mode 100644 board/samsung/dts/exynos4210-origen.dts
 create mode 100644 board/samsung/dts/exynos4210-trats.dts
 create mode 100644 board/samsung/dts/exynos4210-universal_c210.dts
 create mode 100644 board/samsung/dts/exynos4412-trats2.dts
 create mode 100644 include/configs/exynos4-dt.h

-- 
1.7.9.5

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


[U-Boot] [PATCH 3/9] video:exynos_fb:fdt: add additional fdt data

2014-01-27 Thread Piotr Wilczek
This patch adds additional data parsing from DTB.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 drivers/video/exynos_fb.c |   19 +++
 1 file changed, 19 insertions(+)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d4863e8..7e0099f 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -20,6 +20,7 @@
 #include asm/arch/dp_info.h
 #include asm/arch/system.h
 #include asm-generic/errno.h
+#include libtizen.h
 
 #include exynos_fb.h
 
@@ -269,6 +270,21 @@ int exynos_fimd_parse_dt(const void *blob)
panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
samsung,dual-lcd-enabled, 0);
 
+   panel_info.logo_on = fdtdec_get_int(blob, node,
+   samsung,logo-on, 0);
+
+   panel_info.resolution = fdtdec_get_int(blob, node,
+   samsung,resolution, 0);
+
+   panel_info.rgb_mode = fdtdec_get_int(blob, node,
+   samsung,rgb-mode, 0);
+
+   panel_info.power_on_delay = fdtdec_get_int(blob, node,
+   samsung,power-on-delay, 0);
+
+#ifdef CONFIG_TIZEN
+   get_tizen_logo_info(panel_info);
+#endif
return 0;
 }
 #endif
@@ -281,6 +297,9 @@ void lcd_ctrl_init(void *lcdbase)
 #ifdef CONFIG_OF_CONTROL
if (exynos_fimd_parse_dt(gd-fdt_blob))
debug(Can't get proper panel info\n);
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
+   exynos_init_dsim_platform_data(panel_info);
+#endif
 #else
/* initialize parameters which is specific to panel. */
init_panel_info(panel_info);
-- 
1.7.9.5

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


[U-Boot] [PATCH 6/9] board:origen:fdt: Enable device tree on Origen

2014-01-27 Thread Piotr Wilczek
This patch enables to run Origen board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Chander Kashyap k.chan...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 board/samsung/dts/exynos4210-origen.dts |   45 ++
 board/samsung/origen/origen.c   |   86 +-
 include/configs/origen.h|  103 +++
 3 files changed, 85 insertions(+), 149 deletions(-)
 create mode 100644 board/samsung/dts/exynos4210-origen.dts

diff --git a/board/samsung/dts/exynos4210-origen.dts 
b/board/samsung/dts/exynos4210-origen.dts
new file mode 100644
index 000..5c9d2ae
--- /dev/null
+++ b/board/samsung/dts/exynos4210-origen.dts
@@ -0,0 +1,45 @@
+/*
+ * Samsung's Exynos4210 based Origen board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ skeleton.dtsi
+/include/ exynos4.dtsi
+
+/ {
+   model = Insignal Origen evaluation board based on Exynos4210;
+   compatible = insignal,origen, samsung,exynos4210;
+
+   chosen {
+   bootargs =;
+   };
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   status = disabled;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 15f77ca..5873770 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -11,17 +11,22 @@
 #include asm/arch/mmc.h
 #include asm/arch/periph.h
 #include asm/arch/pinmux.h
+#include usb.h
 
 DECLARE_GLOBAL_DATA_PTR;
 struct exynos4_gpio_part1 *gpio1;
 struct exynos4_gpio_part2 *gpio2;
 
-int board_init(void)
+u32 get_board_rev(void)
+{
+   return 0;
+}
+
+int exynos_init(void)
 {
gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
 
-   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
return 0;
 }
 
@@ -56,84 +61,27 @@ static int board_uart_init(void)
return 0;
 }
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
-{
-   int err;
-   err = board_uart_init();
-   if (err) {
-   debug(UART init failed\n);
-   return err;
-   }
-   return err;
-}
-#endif
-
-int dram_init(void)
+int board_usb_init(int index, enum usb_init_type init)
 {
-   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
-   + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
-
return 0;
 }
 
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \
-   PHYS_SDRAM_1_SIZE);
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, \
-   PHYS_SDRAM_2_SIZE);
-   gd-bd-bi_dram[2].start = PHYS_SDRAM_3;
-   gd-bd-bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3, \
-   PHYS_SDRAM_3_SIZE);
-   gd-bd-bi_dram[3].start = PHYS_SDRAM_4;
-   gd-bd-bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4, \
-   PHYS_SDRAM_4_SIZE);
-}
-
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
+#ifdef CONFIG_USB_CABLE_CHECK
+int usb_cable_connected(void)
 {
-   printf(\nBoard: ORIGEN\n);
return 0;
 }
 #endif
 
-#ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
 {
-   int i, err;
-
-   /*
-* MMC2 SD card GPIO:
-*
-* GPK2[0]  SD_2_CLK(2)
-* GPK2[1]  SD_2_CMD(2)
-* GPK2[2]  SD_2_CDn
-* GPK2[3:6]SD_2_DATA[0:3](2)
-*/
-   for (i = 0; i  7; i++) {
-   /* GPK2[0:6] special function 2 */
-   s5p_gpio_cfg_pin(gpio2-k2, i, GPIO_FUNC(0x2));
-
-   /* GPK2[0:6] drv 4x */
-   s5p_gpio_set_drv(gpio2-k2, i, GPIO_DRV_4X);
-
-   /* GPK2[0:1] pull disable */
-   if (i == 0 || i == 1

[U-Boot] [PATCH 5/9] arm:exynos: add common board file for exynos 4

2014-01-27 Thread Piotr Wilczek
This patch adds common board file for Exynos 4 based boards.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/dts/exynos4.dtsi|  139 +++
 board/samsung/common/Makefile|1 +
 board/samsung/common/board_exynos4.c |   83 +
 include/configs/exynos4-dt.h |  170 ++
 4 files changed, 393 insertions(+)
 create mode 100644 arch/arm/dts/exynos4.dtsi
 create mode 100644 board/samsung/common/board_exynos4.c
 create mode 100644 include/configs/exynos4-dt.h

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
new file mode 100644
index 000..38a6919
--- /dev/null
+++ b/arch/arm/dts/exynos4.dtsi
@@ -0,0 +1,139 @@
+/*
+ * Samsung's Exynos4 SoC common device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/include/ skeleton.dtsi
+
+/ {
+
+   serial@1380 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1380 0x3c;
+   id = 0;
+   };
+
+   serial@1381 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1381 0x3c;
+   id = 1;
+   };
+
+   serial@1382 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1382 0x3c;
+   id = 2;
+   };
+
+   serial@1383 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1383 0x3c;
+   id = 3;
+   };
+
+   serial@1384 {
+   compatible = samsung,exynos4210-uart;
+   reg = 0x1384 0x3c;
+   id = 4;
+   };
+
+   i2c@1386 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 0 0 0;
+   };
+
+   i2c@1387 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 1 1 0;
+   };
+
+   i2c@1388 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 2 2 0;
+   };
+
+   i2c@1389 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 3 3 0;
+   };
+
+   i2c@138a {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 4 4 0;
+   };
+
+   i2c@138b {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 5 5 0;
+   };
+
+   i2c@138c {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 6 6 0;
+   };
+
+   i2c@138d {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,s3c2440-i2c;
+   interrupts = 7 7 0;
+   };
+
+   sdhci@1251 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1251 0x1000;
+   interrupts = 0 75 0;
+   };
+
+   sdhci@1252 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1252 0x1000;
+   interrupts = 0 76 0;
+   };
+
+   sdhci@1253 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1253 0x1000;
+   interrupts = 0 77 0;
+   };
+
+   sdhci@1254 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-mmc;
+   reg = 0x1254 0x1000;
+   interrupts = 0 78 0;
+   };
+
+   gpio: gpio {
+   gpio-controller;
+   #gpio-cells = 2;
+
+   interrupt-controller;
+   #interrupt-cells = 2;
+   };
+};
diff --git a/board/samsung/common/Makefile b/board/samsung/common/Makefile
index 7d2bb8c..25f1e40 100644
--- a/board/samsung/common/Makefile
+++ b/board/samsung/common/Makefile
@@ -12,4 +12,5 @@ obj-$(CONFIG_MISC_COMMON) += misc.o
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_BOARD_COMMON) += board.o
+obj-$(CONFIG_BOARD_COMMON_EXYNOS4) += board_exynos4.o
 endif
diff --git a/board/samsung/common/board_exynos4.c 
b/board/samsung/common/board_exynos4.c
new file mode 100644
index 000..2d313e6
--- /dev/null
+++ b/board/samsung

[U-Boot] [PATCH 4/9] drivers:mmc:sdhci: enable support for DT

2014-01-27 Thread Piotr Wilczek
This patch enables support for device tree for sdhci driver.
Non DT case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 arch/arm/include/asm/arch-exynos/mmc.h |7 ++
 drivers/mmc/s5p_sdhci.c|  130 +++-
 include/fdtdec.h   |1 +
 include/sdhci.h|5 ++
 lib/fdtdec.c   |1 +
 5 files changed, 143 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-exynos/mmc.h 
b/arch/arm/include/asm/arch-exynos/mmc.h
index 98d6530..0fb6461 100644
--- a/arch/arm/include/asm/arch-exynos/mmc.h
+++ b/arch/arm/include/asm/arch-exynos/mmc.h
@@ -53,6 +53,8 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x)  16)
 #define SDHCI_CTRL4_DRIVE_SHIFT(16)
 
+#define SDHCI_MAX_HOSTS 4
+
 int s5p_sdhci_init(u32 regbase, int index, int bus_width);
 
 static inline int s5p_mmc_init(int index, int bus_width)
@@ -62,4 +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
 
return s5p_sdhci_init(base, index, bus_width);
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_mmc_init(const void *blob);
+#endif
+
 #endif
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 40ff873..7456ee0 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -8,9 +8,15 @@
 #include common.h
 #include malloc.h
 #include sdhci.h
+#include fdtdec.h
+#include libfdt.h
+#include asm/gpio.h
 #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)
 {
@@ -86,3 +92,125 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 
return add_sdhci(host, 5200, 40);
 }
+
+#ifdef CONFIG_OF_CONTROL
+struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
+
+static int do_sdhci_init(struct sdhci_host *host)
+{
+   int dev_id, flag;
+   int err = 0;
+
+   flag = host-bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
+   dev_id = host-index + PERIPH_ID_SDMMC0;
+
+   if (fdt_gpio_isvalid(host-pwr_gpio)) {
+   gpio_direction_output(host-pwr_gpio.gpio, 1);
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   debug(MMC not configured\n);
+   return err;
+   }
+   }
+
+   if (fdt_gpio_isvalid(host-cd_gpio)) {
+   gpio_direction_output(host-cd_gpio.gpio, 0xf);
+   if (gpio_get_value(host-cd_gpio.gpio))
+   return -ENODEV;
+
+   err = exynos_pinmux_config(dev_id, flag);
+   if (err) {
+   printf(external SD not configured\n);
+   return err;
+   }
+   }
+
+   host-name = S5P_NAME;
+
+   host-quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE |
+   SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR |
+   SDHCI_QUIRK_WAIT_SEND_CMD;
+   host-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
+
+   host-set_control_reg = s5p_sdhci_set_control_reg;
+   host-set_clock = set_mmc_clk;
+
+   host-host_caps = MMC_MODE_HC;
+
+   return add_sdhci(host, 5200, 40);
+}
+
+static int sdhci_get_config(const void *blob, int node, struct sdhci_host 
*host)
+{
+   int bus_width, dev_id;
+   unsigned int base;
+
+   /* Get device id */
+   dev_id = pinmux_decode_periph_id(blob, node);
+   if (dev_id  PERIPH_ID_SDMMC0) {
+   debug(MMC: Can't get device id\n);
+   return -1;
+   }
+   host-index = dev_id - PERIPH_ID_SDMMC0;
+
+   /* Get bus width */
+   bus_width = fdtdec_get_int(blob, node, samsung,bus-width, 0);
+   if (bus_width = 0) {
+   debug(MMC: Can't get bus-width\n);
+   return -1;
+   }
+   host-bus_width = bus_width;
+
+   /* Get the base address from the device node */
+   base = fdtdec_get_addr(blob, node, reg);
+   if (!base) {
+   debug(DWMMC: Can't get base address\n);
+   return -1;
+   }
+   host-ioaddr = (void *)base;
+
+   fdtdec_decode_gpio(blob, node, pwr-gpios, host-pwr_gpio);
+   fdtdec_decode_gpio(blob, node, cd-gpios, host-cd_gpio);
+
+   return 0;
+}
+
+static int process_nodes(const void *blob, int node_list[], int count)
+{
+   struct sdhci_host *host;
+   int i, node;
+
+   debug(%s: count = %d\n, __func__, count);
+
+   /* build sdhci_host[] for each controller */
+   for (i = 0; i  count; i++) {
+   node = node_list[i];
+   if (node = 0)
+   continue;
+
+   host

[U-Boot] [PATCH 9/9] board:trats2:fdt: Enable device tree on Trats2

2014-01-27 Thread Piotr Wilczek
This patch enables to run Trats2 board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
 board/samsung/dts/exynos4412-trats2.dts |  434 +++
 board/samsung/trats2/trats2.c   |  216 +--
 include/configs/trats2.h|  199 ++
 3 files changed, 459 insertions(+), 390 deletions(-)
 create mode 100644 board/samsung/dts/exynos4412-trats2.dts

diff --git a/board/samsung/dts/exynos4412-trats2.dts 
b/board/samsung/dts/exynos4412-trats2.dts
new file mode 100644
index 000..c8f847c
--- /dev/null
+++ b/board/samsung/dts/exynos4412-trats2.dts
@@ -0,0 +1,434 @@
+/*
+ * Samsung's Exynos4412 based Trats2 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats2 based on Exynos4412;
+   compatible = samsung,trats2, samsung,exynos4412;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1251;
+   };
+
+   i2c@138d {
+   samsung,i2c-sda-delay = 100;
+   samsung,i2c-slave-addr = 0x10;
+   samsung,i2c-max-bus-freq = 10;
+   status = okay;
+
+   max77686_pmic@09 {
+   compatible = maxim,max77686_pmic;
+   interrupts = 7 0;
+   reg = 0x09 0 0;
+   #clock-cells = 1;
+
+   voltage-regulators {
+   ldo1_reg: ldo1 {
+   regulator-compatible = LDO1;
+   regulator-name = VALIVE_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo2_reg: ldo2 {
+   regulator-compatible = LDO2;
+   regulator-name = VM1M2_1.2V_AP;
+   regulator-min-microvolt = 120;
+   regulator-max-microvolt = 120;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo3_reg: ldo3 {
+   regulator-compatible = LDO3;
+   regulator-name = VCC_1.8V_AP;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo4_reg: ldo4 {
+   regulator-compatible = LDO4;
+   regulator-name = VCC_2.8V_AP;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo5_reg: ldo5 {
+   regulator-compatible = LDO5;
+   regulator-name = VCC_1.8V_IO;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   regulator-mem-on;
+   };
+
+   ldo6_reg: ldo6 {
+   regulator-compatible = LDO6;
+   regulator-name = VMPLL_1.0V_AP;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100

[U-Boot] [PATCH 8/9] trats:fdt: Enable device tree on Trats

2014-01-27 Thread Piotr Wilczek
This patch enables to run Trats board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
CC: Lukasz Majewski l.majew...@samsung.com
---
 board/samsung/dts/exynos4210-trats.dts |  120 ++
 board/samsung/trats/trats.c|  176 +--
 include/configs/trats.h|  177 
 3 files changed, 144 insertions(+), 329 deletions(-)
 create mode 100644 board/samsung/dts/exynos4210-trats.dts

diff --git a/board/samsung/dts/exynos4210-trats.dts 
b/board/samsung/dts/exynos4210-trats.dts
new file mode 100644
index 000..976c6ee
--- /dev/null
+++ b/board/samsung/dts/exynos4210-trats.dts
@@ -0,0 +1,120 @@
+/*
+ * Samsung's Exynos4210 based Trats board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Trats based on Exynos4210;
+   compatible = samsung,trats, samsung,exynos4210;
+
+   config {
+   samsung,dsim-device-name = s6e8ax0;
+   };
+
+   aliases {
+   i2c0 = /i2c@1386;
+   i2c1 = /i2c@1387;
+   i2c2 = /i2c@1388;
+   i2c3 = /i2c@1389;
+   i2c4 = /i2c@138a;
+   i2c5 = /i2c@138b;
+   i2c6 = /i2c@138c;
+   i2c7 = /i2c@138d;
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 720;
+   samsung,vl-row = 1280;
+   samsung,vl-width = 720;
+   samsung,vl-height = 1280;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 5;
+   samsung,vl-hbpd = 10;
+   samsung,vl-hfpd = 10;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 1;
+   samsung,vl-vfpd = 13;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,winid = 0;
+   samsung,power-on-delay = 30;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 1;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+
+   mipidsi@11c8 {
+   compatible = samsung,exynos-mipi-dsi;
+   reg = 0x11c8 0x5c;
+
+   samsung,dsim-config-e_interface = 1;
+   samsung,dsim-config-e_virtual_ch = 0;
+   samsung,dsim-config-e_pixel_format = 7;
+   samsung,dsim-config-e_burst_mode = 1;
+   samsung,dsim-config-e_no_data_lane = 3;
+   samsung,dsim-config-e_byte_clk = 0;
+   samsung,dsim-config-hfp = 1;
+
+   samsung,dsim-config-p = 3;
+   samsung,dsim-config-m = 120;
+   samsung,dsim-config-s = 1;
+
+   samsung,dsim-config-pll_stable_time = 500;
+   samsung,dsim-config-esc_clk = 2000;
+   samsung,dsim-config-stop_holding_cnt = 0x7ff;
+   samsung,dsim-config-bta_timeout = 0xff;
+   samsung,dsim-config-rx_timeout = 0x;
+
+   samsung,dsim-device-id = 0x;
+   samsung,dsim-device-bus_id = 0;
+
+   samsung,dsim-device-reverse_panel = 1;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+};
\ No newline at end of file
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index b725505..9e4554a 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -12,17 +12,14 @@
 #include asm/io.h
 #include asm/arch/cpu.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/clock.h
-#include asm/arch/clk.h
 #include asm/arch/mipi_dsim.h
 #include asm/arch/watchdog.h
 #include asm/arch/power.h
 #include power/pmic.h

[U-Boot] [PATCH 1/9] exynos4:pinmux:fdt: decode peripheral id

2014-01-27 Thread Piotr Wilczek
This patch adds api to decode peripheral id based in interrupt number.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
---
 arch/arm/cpu/armv7/exynos/pinmux.c |   21 +
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 904177a..3201d53 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -741,6 +741,25 @@ int exynos_pinmux_config(int peripheral, int flags)
 }
 
 #ifdef CONFIG_OF_CONTROL
+
+static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
+{
+   int err;
+   u32 cell[3];
+
+   err = fdtdec_get_int_array(blob, node, interrupts, cell,
+   ARRAY_SIZE(cell));
+   if (err)
+   return PERIPH_ID_NONE;
+
+   /* check for invalid peripheral id */
+   if ((PERIPH_ID_SDMMC4  cell[1]) || (cell[1]  PERIPH_ID_UART0))
+   return cell[1];
+
+   debug( invalid peripheral id\n);
+   return PERIPH_ID_NONE;
+}
+
 static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 {
int err;
@@ -763,6 +782,8 @@ int pinmux_decode_periph_id(const void *blob, int node)
 {
if (cpu_is_exynos5())
return  exynos5_pinmux_decode_periph_id(blob, node);
+   else if (cpu_is_exynos4())
+   return  exynos4_pinmux_decode_periph_id(blob, node);
else
return PERIPH_ID_NONE;
 }
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/9] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-01-27 Thread Piotr Wilczek
This patch enables parsing mipi data from device tree.
Non device tree case is still supported.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |3 +
 drivers/video/exynos_mipi_dsi.c  |   98 ++
 include/fdtdec.h |1 +
 lib/fdtdec.c |1 +
 4 files changed, 103 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 40aca71..c9e8e06 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -12,6 +12,7 @@
 
 #include linux/list.h
 #include linux/fb.h
+#include lcd.h
 
 #define PANEL_NAME_SIZE(32)
 
@@ -368,8 +369,10 @@ int exynos_mipi_dsi_register_lcd_device(struct 
mipi_dsim_lcd_device
*lcd_dev);
 
 void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
+void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
 /* panel driver init based on mipi dsi interface */
 void s6e8ax0_init(void);
 
+extern int mipi_power(void);
 #endif /* _DSIM_H */
diff --git a/drivers/video/exynos_mipi_dsi.c b/drivers/video/exynos_mipi_dsi.c
index 8bb8fea..ab15ad6 100644
--- a/drivers/video/exynos_mipi_dsi.c
+++ b/drivers/video/exynos_mipi_dsi.c
@@ -9,6 +9,8 @@
 
 #include common.h
 #include malloc.h
+#include fdtdec.h
+#include libfdt.h
 #include linux/err.h
 #include asm/arch/dsim.h
 #include asm/arch/mipi_dsim.h
@@ -22,7 +24,12 @@
 #define master_to_driver(a)(a-dsim_lcd_drv)
 #define master_to_device(a)(a-dsim_lcd_dev)
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static struct exynos_platform_mipi_dsim *dsim_pd;
+static struct mipi_dsim_config dsim_config_dt;
+static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
+static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
 
 struct mipi_dsim_ddi {
int bus_id;
@@ -238,3 +245,94 @@ void exynos_set_dsim_platform_data(struct 
exynos_platform_mipi_dsim *pd)
 
dsim_pd = pd;
 }
+
+#ifdef CONFIG_OF_CONTROL
+int exynos_dsim_config_parse_dt(const void *blob)
+{
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
+   if (node = 0) {
+   printf(exynos_mipi_dsi: Can't get device node for mipi dsi\n);
+   return -ENODEV;
+   }
+
+   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_interface, 0);
+
+   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_virtual_ch, 0);
+
+   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_pixel_format, 0);
+
+   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_burst_mode, 0);
+
+   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_no_data_lane, 0);
+
+   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-e_byte_clk, 0);
+
+   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
+   samsung,dsim-config-hfp, 0);
+
+   dsim_config_dt.p = fdtdec_get_int(blob, node,
+ samsung,dsim-config-p, 0);
+   dsim_config_dt.m = fdtdec_get_int(blob, node,
+ samsung,dsim-config-m, 0);
+   dsim_config_dt.s = fdtdec_get_int(blob, node,
+ samsung,dsim-config-s, 0);
+
+   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
+   samsung,dsim-config-pll_stable_time, 0);
+
+   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
+   samsung,dsim-config-esc_clk, 0);
+
+   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
+   samsung,dsim-config-stop_holding_cnt, 0);
+
+   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-bta_timeout, 0);
+
+   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
+   samsung,dsim-config-rx_timeout, 0);
+
+   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
+   samsung,dsim-device-name);
+
+   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node,
+   samsung,dsim-device-id, 0);
+
+   mipi_lcd_device_dt.bus_id = fdtdec_get_int(blob, node,
+   samsung,dsim-device-bus_id, 0);
+
+   mipi_lcd_device_dt.reverse_panel = fdtdec_get_int(blob, node

[U-Boot] [PATCH 7/9] board:universal:fdt: Enable device tree on Universal

2014-01-27 Thread Piotr Wilczek
This patch enables to run Universal board on device tree.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc:  Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 board/samsung/dts/exynos4210-universal_c210.dts |   83 +++
 board/samsung/universal_c210/universal.c|  178 ++-
 include/configs/s5pc210_universal.h |  128 +++-
 3 files changed, 144 insertions(+), 245 deletions(-)
 create mode 100644 board/samsung/dts/exynos4210-universal_c210.dts

diff --git a/board/samsung/dts/exynos4210-universal_c210.dts 
b/board/samsung/dts/exynos4210-universal_c210.dts
new file mode 100644
index 000..1cdd981
--- /dev/null
+++ b/board/samsung/dts/exynos4210-universal_c210.dts
@@ -0,0 +1,83 @@
+/*
+ * Samsung's Exynos4210 based Universal C210 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung Universal C210 based on Exynos4210 rev0;
+   compatible = samsung,universal_c210, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   mmc0 = sdhci@1251;
+   mmc2 = sdhci@1253;
+   };
+
+   sdhci@1251 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   pwr-gpios = gpio 0x2008002 0;
+   };
+
+   sdhci@1252 {
+   status = disabled;
+   };
+
+   sdhci@1253 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   cd-gpios = gpio 0x20c6004 0;
+   };
+
+   sdhci@1254 {
+   status = disabled;
+   };
+
+   fimd@11c0 {
+   compatible = samsung,exynos-fimd;
+   reg = 0x11c0 0xa4;
+
+   samsung,vl-freq = 60;
+   samsung,vl-col = 480;
+   samsung,vl-row = 800;
+   samsung,vl-width = 480;
+   samsung,vl-height = 800;
+
+   samsung,vl-clkp = 0;
+   samsung,vl-oep = 0;
+   samsung,vl-hsp = 1;
+   samsung,vl-vsp = 1;
+   samsung,vl-dp = 1;
+   samsung,vl-bpix = 4;
+
+   samsung,vl-hspw = 2;
+   samsung,vl-hbpd = 16;
+   samsung,vl-hfpd = 16;
+   samsung,vl-vspw = 2;
+   samsung,vl-vbpd = 8;
+   samsung,vl-vfpd = 8;
+   samsung,vl-cmd-allow-len = 0xf;
+
+   samsung,pclk_name = 1;
+   samsung,sclk_div = 1;
+
+   samsung,winid = 0;
+   samsung,power-on-delay = 1;
+   samsung,interface-mode = 1;
+   samsung,mipi-enabled = 0;
+   samsung,dp-enabled;
+   samsung,dual-lcd-enabled;
+
+   samsung,logo-on = 1;
+   samsung,resolution = 0;
+   samsung,rgb-mode = 0;
+   };
+};
diff --git a/board/samsung/universal_c210/universal.c 
b/board/samsung/universal_c210/universal.c
index 5ce74b7..7668e33 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -13,16 +13,16 @@
 #include asm/gpio.h
 #include asm/arch/adc.h
 #include asm/arch/gpio.h
-#include asm/arch/mmc.h
 #include asm/arch/pinmux.h
 #include asm/arch/watchdog.h
-#include libtizen.h
 #include ld9040.h
 #include power/pmic.h
+#include usb.h
 #include usb/s3c_udc.h
 #include asm/arch/cpu.h
 #include power/max8998_pmic.h
 #include samsung/misc.h
+#include usb_mass_storage.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -50,7 +50,7 @@ int power_init_board(void)
 * For PMIC the I2C bus is named as I2C5, but it is connected
 * to logical I2C adapter 0
 */
-   ret = pmic_init(I2C_5);
+   ret = pmic_init(I2C_0);
if (ret)
return ret;
 
@@ -59,22 +59,6 @@ int power_init_board(void)
return 0;
 }
 
-int dram_init(void)
-{
-   gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) +
-   get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
-
-   return 0;
-}
-
-void dram_init_banksize(void)
-{
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
-   gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
-}
-
 static unsigned short get_adc_value(int channel)
 {
struct s5p_adc *adc = (struct s5p_adc *)samsung_get_base_adc();
@@ -159,71 +143,6 @@ static void check_hw_revision(void)
board_rev |= hwrev;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
-int checkboard(void)
-{
-   puts(Board:\tUniversal C210\n);
-   return 0;
-}
-#endif
-
-#ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
-{
-   int

[U-Boot] [PATCH V2 0/8] arm: add runtime envs describing build

2014-01-22 Thread Piotr Wilczek
This patchset adds runtime variables for Samsung boards that describe
build configuration (arch, soc, board, vendor).

Additionally, more envs describing platform (soc and board revision) are added
to Samsung common code.

For boards Trats and Trats2, based on the added envs, 'fdtfile' env is set
and dual kernel boot is enabled:
 - with separated DTB if the DTB file is loaded successfully;
 - with DTB apppended to uImage if DTB file is not found;
This is neccesssary for backward compatibilty.

THis patchset depends on the patchset:
[PATCH v6 00/11] Introduce Samsung misc file and LCD menu.
http://patchwork.ozlabs.org/patch/313186/
...
http://patchwork.ozlabs.org/patch/313192/

Changes for V2:
 - rebased against current u-boot0samsung branch

Piotr Wilczek (8):
  arm:exynos: add cpu revision
  arm:s5pc110: add cpu revision
  board:samsung:common: set envs with board unified information
  board:samsung:goni: add env variables describing platform
  board:samsung:universal: add env variables describing platform
  board:samsung:trats: add env variables describing platform
  board:samsung:trats2: add env variables describing platform
  board:samsung:trats/trats2: enable boot with appended and separated
DTB

 arch/arm/include/asm/arch-exynos/cpu.h   |8 ++--
 arch/arm/include/asm/arch-s5pc1xx/cpu.h  |7 +++
 board/samsung/common/misc.c  |   24 
 board/samsung/goni/goni.c|   17 +
 board/samsung/trats/trats.c  |3 +++
 board/samsung/trats2/trats2.c|3 +++
 board/samsung/universal_c210/universal.c |3 +++
 include/configs/s5p_goni.h   |6 ++
 include/configs/s5pc210_universal.h  |3 +++
 include/configs/trats.h  |   12 +---
 include/configs/trats2.h |   12 +---
 include/samsung/misc.h   |   12 
 12 files changed, 98 insertions(+), 12 deletions(-)

-- 
1.7.9.5

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


[U-Boot] [PATCH V2 1/8] arm:exynos: add cpu revision

2014-01-22 Thread Piotr Wilczek
This patch enables to read cpu revision on Exynos CPU.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
Changes for V2:
 - none

 arch/arm/include/asm/arch-exynos/cpu.h |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index 573f755..bccce63 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -185,9 +185,11 @@ static inline int s5p_get_cpu_rev(void)
 
 static inline void s5p_set_cpu_id(void)
 {
-   unsigned int pro_id = (readl(EXYNOS4_PRO_ID)  0x00FFF000)  12;
+   unsigned int pro_id = readl(EXYNOS4_PRO_ID);
+   unsigned int cpu_id = (pro_id  0x00FFF000)  12;
+   unsigned int cpu_rev = pro_id  0x00FF;
 
-   switch (pro_id) {
+   switch (cpu_id) {
case 0x200:
/* Exynos4210 EVT0 */
s5p_cpu_id = 0x4210;
@@ -196,10 +198,12 @@ static inline void s5p_set_cpu_id(void)
case 0x210:
/* Exynos4210 EVT1 */
s5p_cpu_id = 0x4210;
+   s5p_cpu_rev = cpu_rev;
break;
case 0x412:
/* Exynos4412 */
s5p_cpu_id = 0x4412;
+   s5p_cpu_rev = cpu_rev;
break;
case 0x520:
/* Exynos5250 */
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 3/8] board:samsung:common: set envs with board unified information

2014-01-22 Thread Piotr Wilczek
This patch sets envs that describe board information.
The following envs are set: soc_id, soc_rev, board_rev.
Based on this information, if CONFIG_OF_LIBFDT is enabled,
the 'fdtfile' env is set as:
fdtfile=${soc_family}${soc_id}-${board}.dtb

The generated envs are intenionally not saved to persistent storage.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
Changes for V2:
 - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu

 board/samsung/common/misc.c |   24 
 include/samsung/misc.h  |   12 
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 643f957..eb15739 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -21,6 +21,30 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+void set_board_info(void)
+{
+   char info[64];
+
+   snprintf(info, ARRAY_SIZE(info), %d.%d, s5p_cpu_rev  0x0f,
+(s5p_cpu_rev  0xf0)  0x04);
+   setenv(soc_rev, info);
+
+   snprintf(info, ARRAY_SIZE(info), %x, s5p_cpu_id);
+   setenv(soc_id, info);
+
+#ifdef CONFIG_REVISION_TAG
+   snprintf(info, ARRAY_SIZE(info), %x, get_board_rev());
+   setenv(board_rev, info);
+#endif
+#ifdef CONFIG_OF_LIBFDT
+   snprintf(info, ARRAY_SIZE(info),  %s%x-%s.dtb,
+CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+   setenv(fdtfile, info);
+#endif
+}
+#endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
+
 #ifdef CONFIG_LCD_MENU
 static int power_key_pressed(u32 reg)
 {
diff --git a/include/samsung/misc.h b/include/samsung/misc.h
index 1a6d47f..ede6c15 100644
--- a/include/samsung/misc.h
+++ b/include/samsung/misc.h
@@ -1,6 +1,14 @@
 #ifndef __SAMSUNG_MISC_COMMON_H__
 #define __SAMSUNG_MISC_COMMON_H__
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void);
+#endif
+
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+void set_board_info(void);
+#endif
+
 #ifdef CONFIG_LCD_MENU
 enum {
BOOT_MODE_INFO,
@@ -10,10 +18,6 @@ enum {
BOOT_MODE_EXIT,
 };
 
-#ifdef CONFIG_REVISION_TAG
-u32 get_board_rev(void);
-#endif
-
 void keys_init(void);
 void check_boot_mode(void);
 #endif /* CONFIG_LCD_MENU */
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 4/8] board:samsung:goni: add env variables describing platform

2014-01-22 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Mateusz Zalega m.zal...@samsung.com
---
Changes for V2:
 - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu

 board/samsung/goni/goni.c  |   17 +
 include/configs/s5p_goni.h |6 ++
 2 files changed, 23 insertions(+)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 366f648..61b9ece 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -13,10 +13,17 @@
 #include usb/s3c_udc.h
 #include asm/arch/cpu.h
 #include power/max8998_pmic.h
+#include samsung/misc.h
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static struct s5pc110_gpio *s5pc110_gpio;
 
+u32 get_board_rev(void)
+{
+   return 0;
+}
+
 int board_init(void)
 {
/* Set Initial global variables */
@@ -173,3 +180,13 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
.usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
 };
 #endif
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
+   return 0;
+}
+#endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 4cdf937..991c43e 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -34,6 +34,7 @@
 
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
+#define CONFIG_REVISION_TAG
 #define CONFIG_INITRD_TAG
 #define CONFIG_CMDLINE_EDITING
 
@@ -113,8 +114,13 @@
 
 #define CONFIG_UBIFS_OPTIONrootflags=bulk_read,no_chk_data_crc
 
+#define CONFIG_MISC_COMMON
+#define CONFIG_MISC_INIT_R
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS  \
CONFIG_UPDATEB \
updatek= \
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 6/8] board:samsung:trats: add env variables describing platform

2014-01-22 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
---
Changes for V2:
 - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu

 board/samsung/trats/trats.c |3 +++
 include/configs/trats.h |3 +++
 2 files changed, 6 insertions(+)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index c6664e7..b725505 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -791,6 +791,9 @@ void init_panel_info(vidinfo_t *vid)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
 #ifdef CONFIG_LCD_MENU
keys_init();
check_boot_mode();
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 1de971c..18b4e2f 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -149,6 +149,9 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
bootk= \
run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 7/8] board:samsung:trats2: add env variables describing platform

2014-01-22 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
Changes for V2:
 - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu

 board/samsung/trats2/trats2.c |3 +++
 include/configs/trats2.h  |3 +++
 2 files changed, 6 insertions(+)

diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index 62e7fd2..c17c24d 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -616,6 +616,9 @@ void init_panel_info(vidinfo_t *vid)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
 #ifdef CONFIG_LCD_MENU
keys_init();
check_boot_mode();
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index c48e3f5..7daa445 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -150,6 +150,9 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
 /* Tizen - partitions definitions */
 #define PARTS_CSA  csa
 #define PARTS_BOOT boot
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 2/8] arm:s5pc110: add cpu revision

2014-01-22 Thread Piotr Wilczek
This patch adds s5p_cpu_rev.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
Changes for V2:
 - none

 arch/arm/include/asm/arch-s5pc1xx/cpu.h |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h 
b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
index 4fc5a0c..5ae5c87 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
@@ -51,10 +51,17 @@
 #include asm/io.h
 /* CPU detection macros */
 extern unsigned int s5p_cpu_id;
+extern unsigned int s5p_cpu_rev;
+
+static inline int s5p_get_cpu_rev(void)
+{
+   return s5p_cpu_rev;
+}
 
 static inline void s5p_set_cpu_id(void)
 {
s5p_cpu_id = readl(S5PC100_PRO_ID);
+   s5p_cpu_rev = s5p_cpu_id  0x00FF;
s5p_cpu_id = 0xC000 | ((s5p_cpu_id  0x00FFF000)  12);
 }
 
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 5/8] board:samsung:universal: add env variables describing platform

2014-01-22 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Przemyslaw Marczak p.marc...@samsung.com
---
Changes for V2:
 - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu

 board/samsung/universal_c210/universal.c |3 +++
 include/configs/s5pc210_universal.h  |3 +++
 2 files changed, 6 insertions(+)

diff --git a/board/samsung/universal_c210/universal.c 
b/board/samsung/universal_c210/universal.c
index 98b387f..5ce74b7 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -516,6 +516,9 @@ int board_init(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
 #ifdef CONFIG_LCD_MENU
keys_init();
check_boot_mode();
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index bfb044b..67921e9 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -124,6 +124,9 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
 #define CONFIG_EXTRA_ENV_SETTINGS  \
updateb= \
onenand erase 0x0 0x10; \
-- 
1.7.9.5

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


[U-Boot] [PATCH V2 8/8] board:samsung:trats/trats2: enable boot with appended and separated DTB

2014-01-22 Thread Piotr Wilczek
This patch modifies envs to enable dual kernel boot
 - with separated DTB if the DTB file is loaded successfully;
 - with DTB apppended to uImage if DTB file is not found;
This is neccesssary for backward compatibilty.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
---
Changes for V2:
 - squashed separated patches for Trats and Trats2 inito one

 include/configs/trats.h  |9 ++---
 include/configs/trats2.h |9 ++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/configs/trats.h b/include/configs/trats.h
index 18b4e2f..7bd1584 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -154,7 +154,11 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
bootk= \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run loaduimage; \
+   if run loaddtb; then  \
+   bootm 0x40007FC0 - ${fdtaddr}; \
+   fi; \
+   bootm 0x40007FC0;\0 \
updatemmc= \
mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200; \
mmc boot 0 1 1 0\0 \
@@ -177,7 +181,7 @@
mmcboot= \
setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart}  \
${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};  \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run bootk\0 \
bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0 \
boottrace=setenv opts initcall_debug; run bootcmd\0 \
mmcoops=mmc read 0 0x4000 0x40 8; md 0x4000 0x400\0 \
@@ -216,7 +220,6 @@
   setenv spl_imgaddr; \
   setenv spl_addr_tmp;\0 \
fdtaddr=4080\0 \
-   fdtfile=exynos4210-trats.dtb\0
 
 
 /* Miscellaneous configurable options */
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index 7daa445..28270fe 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -180,7 +180,11 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
bootk= \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run loaduimage; \
+   if run loaddtb; then  \
+   bootm 0x40007FC0 - ${fdtaddr}; \
+   fi; \
+   bootm 0x40007FC0;\0 \
updatemmc= \
mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200; \
mmc boot 0 1 1 0\0 \
@@ -194,7 +198,7 @@
mmcboot= \
setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart}  \
${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};  \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run bootk\0 \
bootchart=set opts init=/sbin/bootchartd; run bootcmd\0 \
boottrace=setenv opts initcall_debug; run bootcmd\0 \
verify=n\0 \
@@ -235,7 +239,6 @@
   setenv spl_imgaddr; \
   setenv spl_addr_tmp;\0 \
fdtaddr=4080\0 \
-   fdtfile=exynos4412-trats2.dtb\0
 
 /*
  * Miscellaneous configurable options
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH v5 03/12] samsung: common: Add misc file and common function misc_init_r().

2014-01-15 Thread Piotr Wilczek
Dear Przemyslaw,

 -Original Message-
 From: Przemyslaw Marczak [mailto:p.marc...@samsung.com]
 Sent: Wednesday, January 15, 2014 8:51 AM
 To: Minkyu Kang
 Cc: u-boot@lists.denx.de; jh80.ch...@samsung.com;
 human.hw...@samsung.com; dh09@samsung.com; ideal.s...@samsung.com;
 Piotr Wilczek; Lukasz Majewski
 Subject: Re: [PATCH v5 03/12] samsung: common: Add misc file and common
 function misc_init_r().
 
 Hello,
 
 On 01/15/2014 08:35 AM, Minkyu Kang wrote:
  On 14/01/14 22:55, Przemyslaw Marczak wrote:
  Hello,
  In case of discussion with Piotr Wilczek maybe it is better to make
 some changes in this patch.
 
  On 01/10/2014 03:31 PM, Przemyslaw Marczak wrote:
  Config: CONFIG_MISC_INIT_R enables implementation of misc_init_r()
  in common file::
  - board/samsung/common/misc.c
 
  Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
  Acked-by: Jaehoon Chung jh80.ch...@samsung.com
  ---
  Changes v2:
  - change CONFIG_SAMSUNG to CONFIG_MISC_INIT_R
 
  Changes v3:
  - fix merge conflict in board/samsung/common/Makefile
 
  Changes v4:
  - none
 
  Changes v5:
  - add acked-by
 
 board/samsung/common/Makefile |1 +
 board/samsung/common/misc.c   |   14 ++
 2 files changed, 15 insertions(+)
 create mode 100644 board/samsung/common/misc.c
 
  diff --git a/board/samsung/common/Makefile
  b/board/samsung/common/Makefile index 22bd6b1..79547a3 100644
  --- a/board/samsung/common/Makefile
  +++ b/board/samsung/common/Makefile
  @@ -8,6 +8,7 @@
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
 obj-$(CONFIG_THOR_FUNCTION) += thor.o
 obj-$(CONFIG_CMD_USB_MASS_STORAGE) += ums.o
  +obj-$(CONFIG_MISC_INIT_R) += misc.o
  here change to:
  obj-y += misc.o
 
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_BOARD_COMMON)+= board.o
  diff --git a/board/samsung/common/misc.c
  b/board/samsung/common/misc.c new file mode 100644 index
  000..3764d12
  --- /dev/null
  +++ b/board/samsung/common/misc.c
  @@ -0,0 +1,14 @@
  +/*
  + * Copyright (C) 2013 Samsung Electronics
  + * Przemyslaw Marczak p.marc...@samsung.com
  + *
  + * SPDX-License-Identifier:GPL-2.0+
  + */
  +
  +#include common.h
  +
 
  and here:
  #ifdef CONFIG_MISC_INIT_R
 
  +/* Common for Samsung boards */
  +int misc_init_r(void)
  +{
  +return 0;
  +}
 
  #endif
 
  In this way we can add other functions in the future even without
 CONFIG_MISC_INIT_R.
 
  partly agree.
  But, I doubt what is the role of misc.c file.
  because of the meaning of miscellaneous is ambiguous, this file have
  possibility to be messy.
  So, please let me know what is your plan to this file.
 
 
 I first planned put there only implementation of misc_init_r() and it's
 subfunctions - as the easy way to display logo and menu for Samsung
 boards.
 Piotr has suggested to change the purpose of this file as misc not only
 for misc_init_r implementation...
Przemyslaw, I asked you question: what is the misc.c file for?
If for misc_init_r only then I think the file name misc.c is confusing.
If also other common functions can be put there, then the define MISC_INIT_R
to compile this file is wrong.

 
 
  Is it better solution?
 
  Thank you,
 
  Thanks,
  Minkyu Kang.
 
 
 Thank you,
 --
 Przemyslaw Marczak
 Samsung RD Institute Poland
 Samsung Electronics
 p.marc...@samsung.com

Best regards,
Piotr Wilczek



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


Re: [U-Boot] [PATCH 3/7] board:samsung:common: set envs with board unified information

2014-01-15 Thread Piotr Wilczek


 -Original Message-
 From: Gerhard Sittig [mailto:g...@denx.de]
 Sent: Wednesday, January 15, 2014 5:18 PM
 To: Piotr Wilczek
 Cc: u-boot@lists.denx.de; Kyungmin Park
 Subject: Re: [U-Boot] [PATCH 3/7] board:samsung:common: set envs with
 board unified information
 
 On Tue, Jan 14, 2014 at 08:59 +0100, Piotr Wilczek wrote:
 
  This patch enables to set envs that describe board information.
  The following envs are set (but not saved): soc_id, soc_rev,
 board_rev.
 
 I don't see the not saved part in the patch.  How exactly does a
 saveenv not save those programmatically generated variables?
 (Altera SoCFPGA suffers from the same issue, we may not want to repeat
 this in mainline U-Boot)
 
It means only that I don't save the generated variables to persistent
storage.
I will modify the commit message to be more specific.

  Based on this information, 'fdtaddr' env is set (not saved) as:
  fdtaddr=${soc_family}${soc_id}-${board}.dtb
 
 An address variable resolves to a DTB filename?  That would be
 unexpected.  Or is it a typo in the commit message?
It's a typo, I will fix the commit message.

 
 
 virtually yours
 Gerhard Sittig
 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
 Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de

Best regards,
Piotr Wilczek



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


[U-Boot] [PATCH 0/7] arm: add runtime envs describing build configuration

2014-01-14 Thread Piotr Wilczek
This patchset adds runtime variables for Samsung boards that describe
build configuration (arch, soc, board, vendor).

Additionally, more envs describing platform (soc and board revision) are added
to Samsung common code.

For boards Trats and Trats2, based on the added envs, 'fdtaddr' env is set
and dual kernel boot is enabled:
 - with separated DTB if the DTB file is loaded successfully;
 - with DTB apppended to uImage if DTB file is not found;
This is neccesssary for backward compatibilty.

Piotr Wilczek (7):
  arm:exynos: add cpu revision
  arm:s5pc110: add cpu revision
  board:samsung:common: set envs with board unified information
  board:samsung:goni: add env variables describing platform
  board:samsung:universal: add env variables describing platform
  board:samsung:trats: enable boot with appended and separated DTB
  board:samsung:trats2: enable boot with appended and separated DTB

 arch/arm/include/asm/arch-exynos/cpu.h  |8 ++--
 arch/arm/include/asm/arch-s5pc1xx/cpu.h |7 +++
 board/samsung/common/misc.c |   29 +
 board/samsung/goni/goni.c   |5 +
 include/configs/s5p_goni.h  |4 
 include/configs/s5pc210_universal.h |5 +
 include/configs/trats.h |   14 +++---
 include/configs/trats2.h|   13 ++---
 8 files changed, 77 insertions(+), 8 deletions(-)

-- 
1.7.9.5

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


[U-Boot] [PATCH 1/7] arm:exynos: add cpu revision

2014-01-14 Thread Piotr Wilczek
This patch enables to read cpu revision on Exynos CPU.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/include/asm/arch-exynos/cpu.h |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index 573f755..bccce63 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -185,9 +185,11 @@ static inline int s5p_get_cpu_rev(void)
 
 static inline void s5p_set_cpu_id(void)
 {
-   unsigned int pro_id = (readl(EXYNOS4_PRO_ID)  0x00FFF000)  12;
+   unsigned int pro_id = readl(EXYNOS4_PRO_ID);
+   unsigned int cpu_id = (pro_id  0x00FFF000)  12;
+   unsigned int cpu_rev = pro_id  0x00FF;
 
-   switch (pro_id) {
+   switch (cpu_id) {
case 0x200:
/* Exynos4210 EVT0 */
s5p_cpu_id = 0x4210;
@@ -196,10 +198,12 @@ static inline void s5p_set_cpu_id(void)
case 0x210:
/* Exynos4210 EVT1 */
s5p_cpu_id = 0x4210;
+   s5p_cpu_rev = cpu_rev;
break;
case 0x412:
/* Exynos4412 */
s5p_cpu_id = 0x4412;
+   s5p_cpu_rev = cpu_rev;
break;
case 0x520:
/* Exynos5250 */
-- 
1.7.9.5

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


[U-Boot] [PATCH 6/7] board:samsung:trats: enable boot with appended and separated DTB

2014-01-14 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment and Samsung's common misc initialisation
to provide additional board information in envs.

This patch modifies envs to enable dual kernel boot
 - with separated DTB if the DTB file is loaded successfully;
 - with DTB apppended to uImage if DTB file is not found;
This is neccesssary for backward compatibilty.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
---
 include/configs/trats.h |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/include/configs/trats.h b/include/configs/trats.h
index 0877142..71b1a4e 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -148,9 +148,16 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
bootk= \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run loaduimage; \
+   if run loaddtb; then  \
+   bootm 0x40007FC0 - ${fdtaddr}; \
+   fi; \
+   bootm 0x40007FC0;\0 \
updatemmc= \
mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200; \
mmc boot 0 1 1 0\0 \
@@ -173,7 +180,7 @@
mmcboot= \
setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart}  \
${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};  \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run loaddtb; run bootk\0 \
bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0 \
boottrace=setenv opts initcall_debug; run bootcmd\0 \
mmcoops=mmc read 0 0x4000 0x40 8; md 0x4000 0x400\0 \
@@ -212,7 +219,6 @@
   setenv spl_imgaddr; \
   setenv spl_addr_tmp;\0 \
fdtaddr=4080\0 \
-   fdtfile=exynos4210-trats.dtb\0
 
 
 /* Miscellaneous configurable options */
@@ -254,6 +260,8 @@
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
 
+#define CONFIG_MISC_INIT_R
+
 /* EXT4 */
 #define CONFIG_CMD_EXT4
 #define CONFIG_CMD_EXT4_WRITE
-- 
1.7.9.5

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


[U-Boot] [PATCH 3/7] board:samsung:common: set envs with board unified information

2014-01-14 Thread Piotr Wilczek
This patch enables to set envs that describe board information.
The following envs are set (but not saved): soc_id, soc_rev, board_rev.

Based on this information, 'fdtaddr' env is set (not saved) as:
fdtaddr=${soc_family}${soc_id}-${board}.dtb

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 board/samsung/common/misc.c |   29 +
 1 file changed, 29 insertions(+)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 3764d12..2d81df9 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -7,8 +7,37 @@
 
 #include common.h
 
+extern u32 get_board_rev(void);
+
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+void set_board_info(void)
+{
+   char info[64];
+
+   snprintf(info, ARRAY_SIZE(info), %d.%d, s5p_cpu_rev  0x0f,
+(s5p_cpu_rev  0xf0)  0x04);
+   setenv(soc_rev, info);
+
+   snprintf(info, ARRAY_SIZE(info), %x, s5p_cpu_id);
+   setenv(soc_id, info);
+
+   snprintf(info, ARRAY_SIZE(info), %x, get_board_rev());
+   setenv(board_rev, info);
+
+#ifdef CONFIG_OF_LIBFDT
+   snprintf(info, ARRAY_SIZE(info),  %s%x-%s.dtb,
+CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+   setenv(fdtfile, info);
+#endif
+}
+#endif
+
 /* Common for Samsung boards */
 int misc_init_r(void)
 {
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+   set_board_info();
+#endif
+
return 0;
 }
-- 
1.7.9.5

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


[U-Boot] [PATCH 5/7] board:samsung:universal: add env variables describing platform

2014-01-14 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment.

Samsung's common misc imitialisation is enabled to provide
additional board information in envs.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Przemyslaw Marczak p.marc...@samsung.com
---
 include/configs/s5pc210_universal.h |5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index d9e4c56..5e5f8e0 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -124,6 +124,11 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
+#define CONFIG_MISC_INIT_R
+
 #define CONFIG_EXTRA_ENV_SETTINGS  \
updateb= \
onenand erase 0x0 0x10; \
-- 
1.7.9.5

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


[U-Boot] [PATCH 7/7] board:samsung:trats2: enable boot with appended and separated DTB

2014-01-14 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment and Samsung's common misc initialisation
to provide additional board information in envs.

This patch modifies envs to enable dual kernel boot
- with separated DTB if the DTB file is loaded successfully;
- with DTB apppended to uImage if DTB file is not found;
This is neccesssary for backward compatibilty.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 include/configs/trats2.h |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index 7dfbe98..9d1b461 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -150,6 +150,9 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
 /* Tizen - partitions definitions */
 #define PARTS_CSA  csa
 #define PARTS_BOOT boot
@@ -177,7 +180,11 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
bootk= \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run loaduimage; \
+   if run loaddtb; then  \
+   bootm 0x40007FC0 - ${fdtaddr}; \
+   fi; \
+   bootm 0x40007FC0;\0 \
updatemmc= \
mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200; \
mmc boot 0 1 1 0\0 \
@@ -191,7 +198,7 @@
mmcboot= \
setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart}  \
${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};  \
-   run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0 \
+   run bootk\0 \
bootchart=set opts init=/sbin/bootchartd; run bootcmd\0 \
boottrace=setenv opts initcall_debug; run bootcmd\0 \
verify=n\0 \
@@ -232,7 +239,6 @@
   setenv spl_imgaddr; \
   setenv spl_addr_tmp;\0 \
fdtaddr=4080\0 \
-   fdtfile=exynos4412-trats2.dtb\0
 
 /*
  * Miscellaneous configurable options
@@ -272,6 +278,7 @@
 #define CONFIG_EFI_PARTITION
 #define CONFIG_PARTITION_UUIDS
 
+#define CONFIG_MISC_INIT_R
 #define CONFIG_BOARD_EARLY_INIT_F
 
 /* I2C */
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/7] arm:s5pc110: add cpu revision

2014-01-14 Thread Piotr Wilczek
This patch adds s5p_cpu_rev.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/include/asm/arch-s5pc1xx/cpu.h |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h 
b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
index 4fc5a0c..5ae5c87 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
@@ -51,10 +51,17 @@
 #include asm/io.h
 /* CPU detection macros */
 extern unsigned int s5p_cpu_id;
+extern unsigned int s5p_cpu_rev;
+
+static inline int s5p_get_cpu_rev(void)
+{
+   return s5p_cpu_rev;
+}
 
 static inline void s5p_set_cpu_id(void)
 {
s5p_cpu_id = readl(S5PC100_PRO_ID);
+   s5p_cpu_rev = s5p_cpu_id  0x00FF;
s5p_cpu_id = 0xC000 | ((s5p_cpu_id  0x00FFF000)  12);
 }
 
-- 
1.7.9.5

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


[U-Boot] [PATCH 4/7] board:samsung:goni: add env variables describing platform

2014-01-14 Thread Piotr Wilczek
This patch adds variables describing platform (soc, board, vendor)
to default environment.

Samsung's common misc imitialisation is enabled to provide
additional board information in envs.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Mateusz Zalega m.zal...@samsung.com
---
 board/samsung/goni/goni.c  |5 +
 include/configs/s5p_goni.h |4 
 2 files changed, 9 insertions(+)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 366f648..fb0435e 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -17,6 +17,11 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static struct s5pc110_gpio *s5pc110_gpio;
 
+u32 get_board_rev(void)
+{
+   return 0;
+}
+
 int board_init(void)
 {
/* Set Initial global variables */
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 0590d20..82a8a8c 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -113,8 +113,12 @@
 
 #define CONFIG_UBIFS_OPTIONrootflags=bulk_read,no_chk_data_crc
 
+#define CONFIG_MISC_INIT_R
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS  \
CONFIG_UPDATEB \
updatek= \
-- 
1.7.9.5

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


  1   2   3   4   >