Re: [U-Boot] [PATCH] integrator: pass a Device Tree by default

2013-01-22 Thread Linus Walleij
On Sun, Jan 20, 2013 at 1:53 AM, Marek Vasut ma...@denx.de wrote:
 Dear Linus Walleij,

 This, enabled the FDT library for the Integrators, updates
 the Integrator/CP default command to load and pass a Device
 Tree when booting the kernel from the on-board ethernet,
 define same environment for the Integrator/AP and move the
 load address around to something even.

 Signed-off-by: Linus Walleij linus.wall...@linaro.org

 Shouldn't the load address be 0x8000 instead of 0x800 (it used to be 0x7fc0) ?

0x800 works fine, but honestly I don't know why Peter P ages ago chose the
very odd address 0x7fc0.

But you know U-boot way better than me, and most things work fine it seems.
What is a typical load address?

 Also, setenv loadaddr  is nonsense, just use the usual
 CONFIG_SYS_LOAD_ADDR (which inherently sets the loadaddr env variable). Or do
 you see a problem there?

Not really, it was mainly because there is no way to set the FDT load
address as a variable, e.g. we don't have CONFIG_FDT_LOAD_ADDR,
and I wanted to keep both definitions in the same place, i.e. in the
default boot script.

On the Integrator/AP I have to load the two pieces one at the time,
manually using loady, so it is a bit helpful to have the address prints
at least.

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


[U-Boot] [PATCH] at91sam9x5: mmc: save environment as a file in FAT partition.

2013-01-22 Thread Josh Wu
This patch will save U-Boot environment as a file: uboot.env, in FAT partition 
instead of saving it in raw sector of SD card.
Since saving environment in raw sector has risk of corrupting the SD card and 
only can use very small size.
Save as a FAT file has no above limitation.

Signed-off-by: Josh Wu josh...@atmel.com
---
this patch is based on v2013.01.

 include/configs/at91sam9x5ek.h |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 6fac5ac..b01bb30 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -217,11 +217,13 @@
bootm 0x2200
 #else /* CONFIG_SYS_USE_MMC */
 /* bootstrap + u-boot + env + linux in mmc */
-#define CONFIG_ENV_IS_IN_MMC
-/* For FAT system, most cases it should be in the reserved sector */
-#define CONFIG_ENV_OFFSET  0x2000
-#define CONFIG_ENV_SIZE0x1000
-#define CONFIG_SYS_MMC_ENV_DEV 0
+#define CONFIG_ENV_IS_IN_FAT
+#define CONFIG_FAT_WRITE
+#define FAT_ENV_INTERFACE  mmc
+#define FAT_ENV_FILE   uboot.env
+#define FAT_ENV_DEVICE 0
+#define FAT_ENV_PART   1
+#define CONFIG_ENV_SIZE0x4000
 #endif
 
 #ifdef CONFIG_SYS_USE_MMC
-- 
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] mx6qsabreauto: enable USB host interface

2013-01-22 Thread Dirk Behme
From: Knut Wohlrab knut.wohl...@de.bosch.com

The USB host interface is routed to plug USB1/J30 on the mother board.

Signed-off-by: Knut Wohlrab knut.wohl...@de.bosch.com
---
Changes in v2:
- Don't add an empty board_ehci_hcd_init() to mx6qsabreauto.c. It's
  not needed because board_ehci_hcd_init() is declared as weak.

 include/configs/mx6qsabreauto.h |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h
index f4a082a..f2ff3e1 100644
--- a/include/configs/mx6qsabreauto.h
+++ b/include/configs/mx6qsabreauto.h
@@ -19,6 +19,17 @@
 #define CONFIG_MMCROOT /dev/mmcblk0p2
 #define PHYS_SDRAM_SIZE(2u * 1024 * 1024 * 1024)
 
+/* USB Configs */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_MX6
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_MXC_USB_PORT1
+#define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
+#define CONFIG_MXC_USB_FLAGS   0
+
 #include mx6qsabre_common.h
 
 #define CONFIG_SYS_FSL_USDHC_NUM   2
-- 
1.7.0.4

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


[U-Boot] [PATCH] mpc8xxx: fix DDR init value to use CONFIG_MEM_INIT_VALUE

2013-01-22 Thread Anatolij Gustschin
Configuring custom memory init value using CONFIG_MEM_INIT_VALUE in
the board config file doesn't work and memory is always initialized
to the value 0xdeadbeef. Only use this default value if a board doesn't
define CONFIG_MEM_INIT_VALUE.

Signed-off-by: Anatolij Gustschin ag...@denx.de
Cc: Andy Fleming aflem...@freescale.com
---
 arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
index 8016bcd..26c42f7 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
@@ -1190,7 +1190,11 @@ static void set_ddr_data_init(fsl_ddr_cfg_regs_t *ddr)
 {
unsigned int init_value;/* Initialization value */
 
+#ifdef CONFIG_MEM_INIT_VALUE
+   init_value = CONFIG_MEM_INIT_VALUE;
+#else
init_value = 0xDEADBEEF;
+#endif
ddr-ddr_data_init = init_value;
 }
 
-- 
1.7.11.7

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


Re: [U-Boot] [PATCH 4/9] mx23evk: Add initial board support

2013-01-22 Thread Otavio Salvador
On Tue, Jan 22, 2013 at 12:30 AM, Fabio Estevam feste...@gmail.com wrote:
 On Mon, Jan 21, 2013 at 11:47 PM, Otavio Salvador
 ota...@ossystems.com.br wrote:
 Signed-off-by: Otavio Salvador ota...@ossystems.com.br
 ---
  board/freescale/mx23evk/Makefile   |  47 +++
  board/freescale/mx23evk/mx23evk.c  |  81 
  board/freescale/mx23evk/spl_boot.c | 115 +
  boards.cfg |   1 +
  include/configs/mx23evk.h  | 252 
 +
  5 files changed, 496 insertions(+)
  create mode 100644 board/freescale/mx23evk/Makefile
  create mode 100644 board/freescale/mx23evk/mx23evk.c
  create mode 100644 board/freescale/mx23evk/spl_boot.c
  create mode 100644 include/configs/mx23evk.h

 An entry to MAINTAINERS file is missing.

Right.

 +/*
 + * USB
 + */
 +#ifdef CONFIG_CMD_USB
 +#defineCONFIG_USB_EHCI
 +#defineCONFIG_USB_EHCI_MXS
 +#defineCONFIG_EHCI_MXS_PORT 1
 +#defineCONFIG_EHCI_IS_TDI
 +#defineCONFIG_USB_STORAGE
 +#endif

 Is USB functional? If not, please remove this.

It is not; will check if I can drop it.

--
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] arm: fix CONFIG_DELAY_ENVIRONMENT to act like it claims in the README

2013-01-22 Thread Lucas Stach
No one expects to end up in a delayed environment if
CONFIG_DELAY_ENVIRONMENT isn't defined.

Signed-off-by: Lucas Stach d...@lynxeye.de
---
v2: keep preference of CONFIG_OF_CONTROL and just change default value
---
 arch/arm/lib/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index cfe32cc..9f861cc 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -488,7 +488,7 @@ static char *failed = *** failed ***\n;
 static int should_load_env(void)
 {
 #ifdef CONFIG_OF_CONTROL
-   return fdtdec_get_config_int(gd-fdt_blob, load-environment, 0);
+   return fdtdec_get_config_int(gd-fdt_blob, load-environment, 1);
 #elif defined CONFIG_DELAY_ENVIRONMENT
return 0;
 #else
-- 
1.8.0.2

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


Re: [U-Boot] Flash Not Erased Problem with M29W128GL

2013-01-22 Thread Ramesh K Khokhani
Hi  Angelo  Wolfgang,

I can erase perfectly but can read perfectly.

One thing is that I can write some data in debug mode and without debug mode I 
cant write any bytes in flash.

You can see as follows:

- md 0x4

0004:    
00040010:    
00040020: 6861 63743d46 45433000 65746861..hact=FEC0.etha
00040030: 6464723d 30303a65 303a3063 3a62633addr=00:e0:0c:bc:
00040040: 65353a36 30006761 74657761 7969703de5:60.gatewayip=
00040050: 3139322e 3136322e 312e3100 686f7374192.162.1.1.host
00040060: 6e616d65 3d4d3533 32394556 42006970name=M5329EVB.ip
00040070: 61646472 3d313932 2e313632 2e312e32addr=192.162.1.2
00040080: 006c6f61 643d7466 74702024 7b6c6f61.load=tftp ${loa
00040090: 64616464 72292024 7b752d62 6f6f747ddaddr) ${u-boot}
000400a0: 006c6f61 64616464 723d3430 30313030.loadaddr=400100
000400b0: 3030006d 656d3d33 32323536 6b006e6500.mem=32256k.ne
000400c0: 74646576 3d657468 30006e65 746d6173tdev=eth0.netmas
000400d0: 6b3d3235 352e3235 352e3235 352e3000k=255.255.255.0.
000400e0: 70726f67 3d70726f 74206f66 66203020prog=prot off 0 
000400f0: 3366 663b6572 61203020 33663;era 0 3fff
- erase 0x4 0x5

- Warning: 1 protected sectors will not be erased!
 done
Erased 1 sectors
- protect off all

Un-Protect Flash Bank # 1

 done
- erase 0x4 0x5
. done
Erased 1 sectors
- md 0x4

0004:    
00040010:    
00040020:    
00040030:    
00040040:    
00040050:    
00040060:    
00040070:    
00040080:    
00040090:    
000400a0:    
000400b0:    
000400c0:    
000400d0:    
000400e0:    
000400f0:    

(My comment: Without debug cant write.)

- save 
Saving Environment to Flash...
. done
Un-Protected 1 sectors
Erasing Flash...!
. done
Erased 1 sectors
Writing to Flash...! done
. done
Protected 1 sectors
- md 0x4

0004:    
00040010:    
00040020:    
00040030:    
00040040:    
00040050:    
00040060:    
00040070:    
00040080:    
00040090:    
000400a0:    
000400b0:    
000400c0:    
000400d0:    
000400e0:    
000400f0:    


(With debug I can write but first after 36 bytes.)

- printenv

EXPORT  table = 41f7b0b4, htab.size = 107, htab.filled = 19, size = 0
Unsorted: n=19
  0: 41f181d4 == gatewayip  = 192.162.1.1
  1: 41f181e0 == stdout = serial
  2: 41f182d0 == stderr = serial
  3: 41f1830c == ipaddr = 192.162.1.2
  4: 41f1836c == ethaddr= 00:e0:0c:bc:e5:60
  5: 41f1839c == stdin  = serial
  6: 41f183cc == prog   = prot off 0 3;era 0 3;cp.b 
${loadaddr} 0 ${filesize};save
  7: 41f18414 == bootdelay  = 5
  8: 41f18480 == baudrate   = 115200
  9: 41f184a4 == hostname   = M5329EVB
 10: 41f184b0 == load   = tftp ${loadaddr) ${u-boot}
 11: 41f184e0 == serverip   = 192.162.1.1
 12: 41f184ec == loadaddr   = 4001
 13: 41f1851c == mem= 32256k
 14: 41f1854c == netdev = eth0
 15: 41f18564 == u-boot = u-boot.bin
 16: 41f185b8 == ethact = FEC0
 17: 41f1860c == upd 

Re: [U-Boot] U-Boot Graphics Library?

2013-01-22 Thread Alexander Holler

Am 21.01.2013 02:29, schrieb Alexander Holler:

Am 18.01.2013 21:57, schrieb Simon Glass:

Hi,

On Fri, Jan 18, 2013 at 7:47 AM, Steve Strobel
steve.stro...@link-comm.com wrote:

Maybe the USB flash drive used for recovery could contain not only the image
to be written to flash, but also a bootable OS image used to provide
on-screen messages during the recovery process.  You would still need the
read-only code to provide enough of a UI to boot from the USB flash drive,
but the rest of the messages could be generated by that OS.


Yes that's exactly what we do...and yes we still need the read-only
code to provide a minimal GUI to get things started. That was the
subject of this thread. The recovery mode GUI is provided by a Linux
user space tool, but we need to get there first...


Hmm, maybe the kernel people are more open to such an idea. It would
just be an additional module/driver and would offer other possible use
case too, much more than if such a library would be added to U-Boot.

A minimal kernel is doable with less than 2MB and that Graphics Library
could be implemented as module (statically linked) which uses the
framebuffer, so no userspace would be necessary at all.


Combined e.g. with lua to use some syscalls for loading files, that 
could be imho useful for many other task. E.g. to get rid of bootloaders 
on UEFI systems or to replace initrd's at all (lua in kernel instead of 
a shell in userspace).


Ok, thats stuff which likely would provoke heated discussions, but at 
least I would like such. ;)


But something like lua isn't really needed for the above problem. 
Hardcoding the few steps (e.g. font and picture loading) necessary to 
lead users to insert an usb-stick is imho a pragmatic solution too. The 
kernel devs most likely wouldn't want that (because it's not a generic 
solution), but thats live.


Regards,

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


Re: [U-Boot] [PATCH] integrator: pass a Device Tree by default

2013-01-22 Thread Marek Vasut
Dear Linus Walleij,

 On Sun, Jan 20, 2013 at 1:53 AM, Marek Vasut ma...@denx.de wrote:
  Dear Linus Walleij,
  
  This, enabled the FDT library for the Integrators, updates
  the Integrator/CP default command to load and pass a Device
  Tree when booting the kernel from the on-board ethernet,
  define same environment for the Integrator/AP and move the
  load address around to something even.
  
  Signed-off-by: Linus Walleij linus.wall...@linaro.org
  
  Shouldn't the load address be 0x8000 instead of 0x800 (it used to be
  0x7fc0) ?
 
 0x800 works fine, but honestly I don't know why Peter P ages ago chose the
 very odd address 0x7fc0.
 
 But you know U-boot way better than me, and most things work fine it seems.
 What is a typical load address?

Heh, there ain't any typical load address, the FDT binary is relocated at the 
end of RAM just before boot anyway, so I'm ok with any address you pick, just 
make it a sane one ;)

  Also, setenv loadaddr  is nonsense, just use the usual
  CONFIG_SYS_LOAD_ADDR (which inherently sets the loadaddr env variable).
  Or do you see a problem there?
 
 Not really, it was mainly because there is no way to set the FDT load
 address as a variable, e.g. we don't have CONFIG_FDT_LOAD_ADDR,
 and I wanted to keep both definitions in the same place, i.e. in the
 default boot script.

Makes sense, I'll CC Albert.

 On the Integrator/AP I have to load the two pieces one at the time,
 manually using loady, so it is a bit helpful to have the address prints
 at least.

Yup.

 Yours,
 Linus Walleij

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] integrator: pass a Device Tree by default

2013-01-22 Thread Linus Walleij
On Tue, Jan 22, 2013 at 1:04 PM, Marek Vasut ma...@denx.de wrote:
 On Sun, Jan 20, 2013 at 1:53 AM, Marek Vasut ma...@denx.de wrote:

  Shouldn't the load address be 0x8000 instead of 0x800 (it used to be
  0x7fc0) ?

 0x800 works fine, but honestly I don't know why Peter P ages ago chose the
 very odd address 0x7fc0.

 But you know U-boot way better than me, and most things work fine it seems.
 What is a typical load address?

 Heh, there ain't any typical load address, the FDT binary is relocated at 
 the
 end of RAM just before boot anyway, so I'm ok with any address you pick, just
 make it a sane one ;)

OK but 0x7fc0 was the load address for the kernel, so I was sort of wondering
what a typical place to load the kernel would be, because 0x7fc0 seems
quite arbitrarily chosen...

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


Re: [U-Boot] [PATCH] integrator: pass a Device Tree by default

2013-01-22 Thread Marek Vasut
Dear Linus Walleij,

 On Tue, Jan 22, 2013 at 1:04 PM, Marek Vasut ma...@denx.de wrote:
  On Sun, Jan 20, 2013 at 1:53 AM, Marek Vasut ma...@denx.de wrote:
   Shouldn't the load address be 0x8000 instead of 0x800 (it used to be
   0x7fc0) ?
  
  0x800 works fine, but honestly I don't know why Peter P ages ago chose
  the very odd address 0x7fc0.
  
  But you know U-boot way better than me, and most things work fine it
  seems. What is a typical load address?
  
  Heh, there ain't any typical load address, the FDT binary is relocated
  at the end of RAM just before boot anyway, so I'm ok with any address
  you pick, just make it a sane one ;)
 
 OK but 0x7fc0 was the load address for the kernel, so I was sort of
 wondering what a typical place to load the kernel would be, because
 0x7fc0 seems quite arbitrarily chosen...

Indeed. I usually stick FDT far past the kernel, but that's just my preference 
I 
think.

 Yours,
 Linus Walleij

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] video: exynos_dp: Remove unused variable disp_info

2013-01-22 Thread Simon Glass
On Mon, Jan 14, 2013 at 1:32 AM, Ajay Kumar ajaykumar...@samsung.com wrote:
 Remove unused variable disp_info to fix the following compilation warning:
 exynos_dp.c: In function 'exynos_init_dp':
 exynos_dp.c:860:23: warning: variable 'disp_info' set but not used
 [-Wunused-but-set-variable]

 Signed-off-by: Ajay Kumar ajaykumar...@samsung.com

Acked-by: Simon Glass s...@chromium.org

 ---
  drivers/video/exynos_dp.c | 2 --
  1 file changed, 2 deletions(-)

 diff --git a/drivers/video/exynos_dp.c b/drivers/video/exynos_dp.c
 index 53e4101..d72fa56 100644
 --- a/drivers/video/exynos_dp.c
 +++ b/drivers/video/exynos_dp.c
 @@ -857,7 +857,6 @@ unsigned int exynos_init_dp(void)
  {
 unsigned int ret;
 struct edp_device_info *edp_info;
 -   struct edp_disp_info disp_info;

 edp_info = kzalloc(sizeof(struct edp_device_info), GFP_KERNEL);
 if (!edp_info) {
 @@ -870,7 +869,6 @@ unsigned int exynos_init_dp(void)
 debug(failed to get edp_info data.\n);
 return -EFAULT;
 }
 -   disp_info = edp_info-disp_info;

 exynos_dp_disp_info(edp_info-disp_info);

 --
 1.8.0

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


[U-Boot] [PATCH 0/3 V2] EXYNOS5: Add GPIO numbering feature

2013-01-22 Thread Rajeshwari Shinde
This patchset adds GPIO numbering feature where pinmux setting
can be done just by sending the pin number which is defined as a
enum in asm/gpio.h.

Changes in V2:
- Enabled CMD_GPIO as suggested by Simon Glass and 
supported same for EXYNOS5

Rajeshwari Shinde (3):
  S5P: GPIO: Add generic pin numbering API's
  EXYNOS5: Add gpio pin numbering feature
  EXYNOS5: GPIO: Enable GPIO Command for EXYNOS5

 arch/arm/cpu/armv7/exynos/pinmux.c  |  148 --
 arch/arm/include/asm/arch-exynos/gpio.h |  448 ++-
 common/cmd_gpio.c   |6 +-
 drivers/gpio/s5p_gpio.c |   18 ++
 include/configs/exynos5250-dt.h |1 +
 5 files changed, 523 insertions(+), 98 deletions(-)

-- 
1.7.4.4

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


[U-Boot] [PATCH 1/3 V2] S5P: GPIO: Add generic pin numbering API's

2013-01-22 Thread Rajeshwari Shinde
This patch adds API's to set config, drive and pull factor in
gpio pin mumbering feature.

Signed-off-by: Rajeshawari Shinde rajeshwar...@samsung.com
---
Changes in V2:
- none.
 drivers/gpio/s5p_gpio.c |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 656bf4a..a53bdca 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -196,3 +196,21 @@ int gpio_set_value(unsigned gpio, int value)
 
return 0;
 }
+
+void gpio_set_pull(int gpio, int mode)
+{
+   s5p_gpio_set_pull(s5p_gpio_get_bank(gpio),
+   s5p_gpio_get_pin(gpio), mode);
+}
+
+void gpio_set_drv(int gpio, int mode)
+{
+   s5p_gpio_set_drv(s5p_gpio_get_bank(gpio),
+   s5p_gpio_get_pin(gpio), mode);
+}
+
+void gpio_cfg_pin(int gpio, int cfg)
+{
+   s5p_gpio_cfg_pin(s5p_gpio_get_bank(gpio),
+   s5p_gpio_get_pin(gpio), cfg);
+}
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/3 V2] EXYNOS5: Add gpio pin numbering feature

2013-01-22 Thread Rajeshwari Shinde
This patch adds support for gpio pin numbering support on EXYNOS5
pinmux.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
Changes in V2:
- none.
 arch/arm/cpu/armv7/exynos/pinmux.c  |  148 +
 arch/arm/include/asm/arch-exynos/gpio.h |  360 ++-
 2 files changed, 413 insertions(+), 95 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index bd499b4..c79d58e 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -29,89 +29,77 @@
 
 static void exynos5_uart_config(int peripheral)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
-   struct s5p_gpio_bank *bank;
int i, start, count;
 
switch (peripheral) {
case PERIPH_ID_UART0:
-   bank = gpio1-a0;
-   start = 0;
+   start = GPIO_A00;
count = 4;
break;
case PERIPH_ID_UART1:
-   bank = gpio1-d0;
-   start = 0;
+   start = GPIO_D00;
count = 4;
break;
case PERIPH_ID_UART2:
-   bank = gpio1-a1;
-   start = 0;
+   start = GPIO_A10;
count = 4;
break;
case PERIPH_ID_UART3:
-   bank = gpio1-a1;
-   start = 4;
+   start = GPIO_A14;
count = 2;
break;
}
for (i = start; i  start + count; i++) {
-   s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
-   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
+   gpio_set_pull(i, GPIO_PULL_NONE);
+   gpio_cfg_pin(i, GPIO_FUNC(0x2));
}
 }
 
 static int exynos5_mmc_config(int peripheral, int flags)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
-   struct s5p_gpio_bank *bank, *bank_ext;
-   int i, start = 0, gpio_func = 0;
+   int i, start, start_ext, gpio_func = 0;
 
switch (peripheral) {
case PERIPH_ID_SDMMC0:
-   bank = gpio1-c0;
-   bank_ext = gpio1-c1;
-   start = 0;
+   start = GPIO_C00;
+   start_ext = GPIO_C10;
gpio_func = GPIO_FUNC(0x2);
break;
case PERIPH_ID_SDMMC1:
-   bank = gpio1-c2;
-   bank_ext = NULL;
+   start = GPIO_C20;
+   start_ext = 0;
break;
case PERIPH_ID_SDMMC2:
-   bank = gpio1-c3;
-   bank_ext = gpio1-c4;
-   start = 3;
+   start = GPIO_C30;
+   start_ext = GPIO_C43;
gpio_func = GPIO_FUNC(0x3);
break;
case PERIPH_ID_SDMMC3:
-   bank = gpio1-c4;
-   bank_ext = NULL;
+   start = GPIO_C40;
+   start_ext = 0;
break;
}
-   if ((flags  PINMUX_FLAG_8BIT_MODE)  !bank_ext) {
+   if ((flags  PINMUX_FLAG_8BIT_MODE)  !start_ext) {
debug(SDMMC device %d does not support 8bit mode,
peripheral);
return -1;
}
if (flags  PINMUX_FLAG_8BIT_MODE) {
-   for (i = start; i = (start + 3); i++) {
-   s5p_gpio_cfg_pin(bank_ext, i, gpio_func);
-   s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_UP);
-   s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
+   for (i = start_ext; i = (start_ext + 3); i++) {
+   gpio_cfg_pin(i, gpio_func);
+   gpio_set_pull(i, GPIO_PULL_UP);
+   gpio_set_drv(i, GPIO_DRV_4X);
}
}
for (i = 0; i  2; i++) {
-   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
-   s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
-   s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
+   gpio_cfg_pin(start + i, GPIO_FUNC(0x2));
+   gpio_set_pull(start + i, GPIO_PULL_NONE);
+   gpio_set_drv(start + i, GPIO_DRV_4X);
}
for (i = 3; i = 6; i++) {
-   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
-   s5p_gpio_set_pull(bank, i, GPIO_PULL_UP);
-   s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
+   gpio_cfg_pin(start + i, GPIO_FUNC(0x2));
+   gpio_set_pull(start + i, GPIO_PULL_UP);
+   gpio_set_drv(start + i, GPIO_DRV_4X);
}
 
return 0;
@@ -119,8 +107,6 @@ static int exynos5_mmc_config(int peripheral, int flags)
 
 static void exynos5_sromc_config(int flags)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *) 

[U-Boot] [PATCH 3/3 V2] EXYNOS5: GPIO: Enable GPIO Command for EXYNOS5

2013-01-22 Thread Rajeshwari Shinde
This patch enables GPIO Command for EXYNOS5.
Function has been added to asm/gpio.h to decode the
input gpio name to gpio number.
example: gpio set gpa00
GPIO_INPUT in cmd_gpio.c has been modified to
GPIO_DIRECTION_INPUT as GPIO_INPUT is alraedy defined in
exynos5 and leading to a error.

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
Chnages in V2:
- New patch
 arch/arm/include/asm/arch-exynos/gpio.h |   88 +++
 common/cmd_gpio.c   |6 +-
 include/configs/exynos5250-dt.h |1 +
 3 files changed, 92 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index af882dd..66e4a8e 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -657,6 +657,94 @@ static inline unsigned int s5p_gpio_part_max(int nr)
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
+
+#include common.h
+
+static inline int name_to_gpio(const char *name)
+{
+   int num;
+
+   name++;
+
+   if (*name == 'p') {
+   ++name;
+
+   switch (*name) {
+   case 'a':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_A00 + num;
+   break;
+   case 'b':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_B00 + num;
+   break;
+   case 'c':
+   name++;
+   num = simple_strtoul(name, NULL, 10);
+   if (num = 40)
+   num = GPIO_C40 + (num - 40);
+   else {
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_C00 + num;
+   }
+   break;
+   case 'd':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_D00 + num;
+   break;
+   case 'y':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_Y00 + num;
+   break;
+   case 'x':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_X00 + num;
+   break;
+   case 'e':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_E00 + num;
+   break;
+   case 'f':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_F00 + num;
+   break;
+   case 'g':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_G00 + num;
+   break;
+   case 'h':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_H00 + num;
+   break;
+   case 'v':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_V00 + num;
+   break;
+   case 'z':
+   name++;
+   num = simple_strtoul(name, NULL, 8);
+   num = GPIO_Z0 + num;
+   break;
+   default:
+   return -1;
+   }
+   } else
+   return -1;
+
+   return num;
+}
+
+#define name_to_gpio(n) name_to_gpio(n)
 #endif
 
 /* Pin configurations */
diff --git a/common/cmd_gpio.c b/common/cmd_gpio.c
index 47eee89..450e6d1 100644
--- a/common/cmd_gpio.c
+++ b/common/cmd_gpio.c
@@ -16,7 +16,7 @@
 #endif
 
 enum gpio_cmd {
-   GPIO_INPUT,
+   GPIO_DIRECTION_INPUT,
GPIO_SET,
GPIO_CLEAR,
GPIO_TOGGLE,
@@ -44,7 +44,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 
/* parse the behavior */
switch (*str_cmd) {
-   case 'i': sub_cmd = GPIO_INPUT;  break;
+   case 'i': sub_cmd = GPIO_DIRECTION_INPUT;  break;
case 's': sub_cmd = GPIO_SET;break;
case 'c': sub_cmd = GPIO_CLEAR;  break;
case 't': sub_cmd = GPIO_TOGGLE; break;
@@ -63,7 +63,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
}
 
/* finally, let's do it: set direction and exec command */
-   if (sub_cmd == GPIO_INPUT) {
+   if (sub_cmd == 

Re: [U-Boot] [PATCH 2/2] video: exynos_fb: Make a call to draw_logo only when CONFIG_CMD_BMP is selected

2013-01-22 Thread Simon Glass
Hi Ajay,

On Mon, Jan 14, 2013 at 1:32 AM, Ajay Kumar ajaykumar...@samsung.com wrote:
 Previously, the call to draw_logo() was happening irrespective
 of whether we have selected logo or LCD console.
 With this patch we call draw_logo() only when CONFIG_CMD_BMP is selected.

 This would even fix the following compilation warning:
 exynos_fb.c: In function 'draw_logo':
 exynos_fb.c:74:8: warning: variable 'addr' set but not used
 [-Wunused-but-set-variable]
 exynos_fb.c:73:9: warning: variable 'y' set but not used
 [-Wunused-but-set-variable]
 exynos_fb.c:73:6: warning: variable 'x' set but not used
 [-Wunused-but-set-variable]

 Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
 ---
  drivers/video/exynos_fb.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
 index 183bca0..ee0ed06 100644
 --- a/drivers/video/exynos_fb.c
 +++ b/drivers/video/exynos_fb.c
 @@ -68,6 +68,7 @@ static void exynos_lcd_init(vidinfo_t *vid)
 lcd_set_flush_dcache(1);
  }

 +#ifdef CONFIG_CMD_BMP
  static void draw_logo(void)
  {
 int x, y;
 @@ -88,10 +89,9 @@ static void draw_logo(void)
 }

 addr = panel_info.logo_addr;
 -#ifdef CONFIG_CMD_BMP
 bmp_display(addr, x, y);
 -#endif
  }
 +#endif

  static void lcd_panel_on(vidinfo_t *vid)
  {
 @@ -150,7 +150,9 @@ void lcd_enable(void)
 if (panel_info.logo_on) {
 memset(lcd_base, 0, panel_width * panel_height *
 (NBITS(panel_info.vl_bpix)  3));
 +#ifdef CONFIG_CMD_BMP
 draw_logo();
 +#endif

It would be nice to avoid another #ifdef. Would it be possible instead
to make the first #ifdef cover the whole internals of the draw_logo()
function?

 }

 lcd_panel_on(panel_info);
 --
 1.8.0


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


Re: [U-Boot] [PATCH 2/2] SMDK5250: Add PMIC voltage settings

2013-01-22 Thread Simon Glass
On Tue, Jan 15, 2013 at 2:25 AM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch adds required pmic voltage settings for SMDK5250.

 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com

Acked-by: Simon Glass s...@chromium.org

(But see a comment nit below)

 ---
  board/samsung/smdk5250/smdk5250.c |  113 
 -
  include/power/max77686_pmic.h |   30 ++
  2 files changed, 141 insertions(+), 2 deletions(-)

 diff --git a/board/samsung/smdk5250/smdk5250.c 
 b/board/samsung/smdk5250/smdk5250.c
 index 7a5f132..12cc03e 100644
 --- a/board/samsung/smdk5250/smdk5250.c
 +++ b/board/samsung/smdk5250/smdk5250.c
 @@ -23,6 +23,7 @@
  #include common.h
  #include fdtdec.h
  #include asm/io.h
 +#include errno.h
  #include i2c.h
  #include lcd.h
  #include netdev.h
 @@ -35,6 +36,7 @@
  #include asm/arch/sromc.h
  #include asm/arch/dp_info.h
  #include power/pmic.h
 +#include power/max77686_pmic.h

  DECLARE_GLOBAL_DATA_PTR;

 @@ -80,12 +82,119 @@ int dram_init(void)
  }

  #if defined(CONFIG_POWER)
 +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;
 +}
 +
  int power_init_board(void)
  {
 +   struct pmic *p;
 +
 +   power_ps_hold_setup();
 +
 +   i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 +
 if (pmic_init(I2C_PMIC))
 return -1;
 -   else
 -   return 0;
 +
 +   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))
 + 

Re: [U-Boot] [PATCH v2 8/9] tegra: add SPI SLINK driver

2013-01-22 Thread Simon Glass
Hi Allen,

On Mon, Jan 14, 2013 at 8:27 PM, Allen Martin amar...@nvidia.com wrote:
 On Sat, Jan 12, 2013 at 08:56:23AM -0800, Simon Glass wrote:
 Hi,

 On Sat, Jan 12, 2013 at 1:07 AM, Allen Martin amar...@nvidia.com wrote:
  Add driver for tegra SPI SLINK style driver.  This controller is
  similar to the tegra20 SPI SFLASH controller.  The difference is
  that the SLINK controller is a genernal purpose SPI controller and the
  SFLASH controller is special purpose and can only talk to FLASH
  devices.  In addition there are potentially many instances of an SLINK
  controller on tegra and only a single instance of SFLASH.  Tegra20 is
  currently ths only version of tegra that instantiates an SFLASH
  controller.
 
  This driver supports basic PIO mode of operation and is configurable
  (CONFIG_OF_CONTROL) to be driven off devicetree bindings.  Up to 4
  devices per controller may be attached, although typically only a
  single chip select line is exposed from tegra per controller so in
  reality this is usually limited to 1.
 
  To enable this driver, use CONFIG_TEGRA_SLINK

 A few comments - note I am on holiday next week so please don't wait
 for my response on the next version.

  ...
  +#include spi.h
  +#ifdef CONFIG_OF_CONTROL

 You probably don't need this ifdef


 ok

  +
  +   spi = malloc(sizeof(struct tegra_spi_slave));

 Please also look at my SPI series where I added an allocate function for 
 this.

 http://patchwork.ozlabs.org/patch/208226/
 http://patchwork.ozlabs.org/patch/208229/


 Nice, thanks.  I propose I should wait for that to land in
 u-boot/master and trick back down to u-boot-arm and u-boot-tegra, and
 then add it in a separate patch.  That way I don't have to add a
 cross repo dependency.

Yes, sounds good.




  +{
  +   int node = 0, i;
  +   struct tegra_spi_ctrl *ctrl;

 blank line here

 ok


  +   for (i = 0; i  CONFIG_TEGRA_SLINK_CTRLS; i++) {
  +   ctrl = spi_ctrls[i];
  +#ifdef CONFIG_OF_CONTROL
  +   node = fdtdec_next_compatible(gd-fdt_blob, node,
  + COMPAT_NVIDIA_TEGRA20_SLINK);
  +   if (!node)
  +   break;

 I think you should be using fdtdec_find_aliases_for_id() so that aliases 
 work.

 I'll reply in Stephen's follow-up on this.


  +   (slave-cs  SLINK_CMD2_SS_EN_SHIFT);
  +   writel(reg, regs-command2);

 Could use clrsetbits_le32() if you like

 Ok


  +   bytes = (num_bytes  4) ?  4 : num_bytes;
  +
  +   if (dout != NULL) {
  +   for (i = 0; i  bytes; ++i)
  +   tmpdout = (tmpdout  8) | dout[i];

 dout += bytes here...

  +   }
  +
  +   num_bytes -= bytes;
  +   if (dout)
  +   dout += bytes;

 instead of here?

 ok


  +
  +   clrsetbits_le32(regs-command, SLINK_CMD_BIT_LENGTH_MASK,
  +   bytes * 8 - 1);
  +   writel(tmpdout, regs-tx_fifo);
  +   setbits_le32(regs-command, SLINK_CMD_GO);
  +
  +   /*
  +* Wait for SPI transmit FIFO to empty, or to time out.
  +* The RX FIFO status will be read and cleared last
  +*/
  +   for (tm = 0, is_read = 0; tm  SPI_TIMEOUT; ++tm) {
  +   u32 status;
  +

 This says timeout but doesn't seem to actually check get_timer(). Also
 is it possible to separate the code that waits for completion from the
 code below?

 You're right about get_timer(), I'll fix that.

 I pulled this loop directly from the tegra20 tegra_spi driver, so I'm
 not the original author, but I believe the reason it's written this
 way is so there's a single timeout loop around the wait for STAT_BSY
 to drop, RXF_EMPTY to drop, and TXF_EMPTY to go high.  It *should* be
 ok to move the TXF_EMPTY wait to a separate wait loop, but I'm a
 little hesitant to touch the code since it's beeen well tested in the
 tegra20 driver, and this part of the driver is identical.

OK, well it's up to you - just a suggestion and what you have works.



  +   status = readl(regs-status);
  +
  +   /* We can exit when we've had both RX and TX 
  activity */
  +   if (is_read  (status  SLINK_STAT_TXF_EMPTY))
  +   break;
  +
  +   if ((status  (SLINK_STAT_BSY | SLINK_STAT_RDY)) !=
  +   SLINK_STAT_RDY)
  +   tm++;
  +
  +   else if (!(status  SLINK_STAT_RXF_EMPTY)) {
  +   tmpdin = readl(regs-rx_fifo);
  +   is_read = 1;
  +
  +   /* swap bytes read in */
  +   if (din != NULL) {
  +   for (i = bytes - 1; i = 0; --i) {
  + 

Re: [U-Boot] [PATCH] Introduce a global bool type

2013-01-22 Thread Måns Rullgård
Albert ARIBAUD albert.u.b...@aribaud.net writes:

 Hi Måns,

 In other words, boolifying on use rather than on assignment is generally
 safer and usually at least as efficient.

 Except when assigning a C = A  B where A and B happen to have
 no common bit set. Which is why I think 'boolifying' as soon as
 possible -- on assignment -- is way safer than on use.

But that's not a boolean context.  You should use A  B.

The thing is, when using a value, you know if you need a boolean, but
not necessarily (easily) how the value was assigned.  Conversely, when
assigning a value, you do not know how it will be used.  By always
boolifying on use, you remove the need to keep track of which values are
true booleans and which ones are arbitrary values (or even pointers)
you happen to be using in a boolean fashion.

-- 
Måns Rullgård
m...@mansr.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] Davinci: Fix, console output confusing while setting MAC address

2013-01-22 Thread Kim Bøndergaard
---
 arch/arm/cpu/arm926ejs/davinci/misc.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/misc.c 
b/arch/arm/cpu/arm926ejs/davinci/misc.c
index d0389a4..dc74af6 100644
--- a/arch/arm/cpu/arm926ejs/davinci/misc.c
+++ b/arch/arm/cpu/arm926ejs/davinci/misc.c
@@ -104,10 +104,8 @@ void davinci_emac_mii_mode_sel(int mode_sel)
 void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 {
uint8_t env_enetaddr[6];
-   int ret;
 
-   ret = eth_getenv_enetaddr_by_index(eth, 0, env_enetaddr);
-   if (ret) {
+   if (!eth_getenv_enetaddr_by_index(eth, 0, env_enetaddr)) {
/*
 * There is no MAC address in the environment, so we
 * initialize it from the value in the EEPROM.
@@ -115,10 +113,9 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
debug(### Setting environment from EEPROM MAC address = 
\%pM\\n,
env_enetaddr);
-   ret = !eth_setenv_enetaddr(ethaddr, rom_enetaddr);
+   if (!eth_setenv_enetaddr(ethaddr, rom_enetaddr))
+   printf(Failed to set mac address from EEPROM\n);
}
-   if (!ret)
-   printf(Failed to set mac address from EEPROM\n);
 }
 #endif /* CONFIG_DRIVER_TI_EMAC */
 
-- 
1.8.0.3

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


[U-Boot] [PATCH 1/2] Davinci: Make MAC address offset in EEPROM configurable, CONFIG_MAC_EEPROM_ADDR

2013-01-22 Thread Kim Bøndergaard
---
 arch/arm/cpu/arm926ejs/davinci/misc.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/misc.c 
b/arch/arm/cpu/arm926ejs/davinci/misc.c
index c310c69..d0389a4 100644
--- a/arch/arm/cpu/arm926ejs/davinci/misc.c
+++ b/arch/arm/cpu/arm926ejs/davinci/misc.c
@@ -55,11 +55,14 @@ void dram_init_banksize(void)
  * Read ethernet MAC address from EEPROM for DVEVM compatible boards.
  * Returns 1 if found, 0 otherwise.
  */
+#ifndef CONFIG_MAC_EEPROM_ADDR
+#define CONFIG_MAC_EEPROM_ADDR 0x7F00
+#endif
 int dvevm_read_mac_address(uint8_t *buf)
 {
 #ifdef CONFIG_SYS_I2C_EEPROM_ADDR
/* Read MAC address. */
-   if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x7F00,
+   if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, CONFIG_MAC_EEPROM_ADDR,
CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (uint8_t *) buf[0], 6))
goto i2cerr;
 
-- 
1.8.0.3

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


[U-Boot] [PATCH 0/2] Davinci, MAC addr improvements

2013-01-22 Thread Kim Bøndergaard
Two fixes related to MAC address setting on Davinci boards.

The following changes since commit 54b08efcf2f4ff532ce99c53f341a59c193331a5:

  README.mips: update known issues and TODOs (2013-01-16 10:52:08 +0100)

are available in the git repository at:

  git://gitorious.org/~kibo/u-boot-shr/kibos-u-boot master
  http://gitorious.org/~kibo/u-boot-shr/kibos-u-boot/commits/master

Kim Bøndergaard (2):
  Davinci: Make MAC address offset in EEPROM configurable,
CONFIG_MAC_EEPROM_ADDR
  Davinci: Fix, console output confusing while setting MAC address

 arch/arm/cpu/arm926ejs/davinci/misc.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

-- 
1.8.0.3

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


Re: [U-Boot] [PATCH v2 8/9] tegra: add SPI SLINK driver

2013-01-22 Thread Simon Glass
Hi Stephen,

On Mon, Jan 14, 2013 at 10:49 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/12/2013 09:56 AM, Simon Glass wrote:
 Hi,

 On Sat, Jan 12, 2013 at 1:07 AM, Allen Martin amar...@nvidia.com wrote:
 Add driver for tegra SPI SLINK style driver.  This controller is
 similar to the tegra20 SPI SFLASH controller.  The difference is
 that the SLINK controller is a genernal purpose SPI controller and the
 SFLASH controller is special purpose and can only talk to FLASH
 devices.  In addition there are potentially many instances of an SLINK
 controller on tegra and only a single instance of SFLASH.  Tegra20 is
 currently ths only version of tegra that instantiates an SFLASH
 controller.

 This driver supports basic PIO mode of operation and is configurable
 (CONFIG_OF_CONTROL) to be driven off devicetree bindings.  Up to 4
 devices per controller may be attached, although typically only a
 single chip select line is exposed from tegra per controller so in
 reality this is usually limited to 1.

 To enable this driver, use CONFIG_TEGRA_SLINK

 diff --git a/drivers/spi/tegra_slink.c b/drivers/spi/tegra_slink.c

 +#ifdef CONFIG_OF_CONTROL

 You probably don't need this ifdef

 If we did assume CONFIG_OF_CONTROL was on, then we could get rid of the
 previous patch; all the device addresses would come from device tree, so
 there would be no need to add them to any header file:-)

As Allen said I just mean we shouldn't need to put #ifdefs around
#include fdtdec.h


 +void spi_init(void)
 +{
 +   int node = 0, i;
 +   struct tegra_spi_ctrl *ctrl;

 blank line here

 +   for (i = 0; i  CONFIG_TEGRA_SLINK_CTRLS; i++) {
 +   ctrl = spi_ctrls[i];
 +#ifdef CONFIG_OF_CONTROL
 +   node = fdtdec_next_compatible(gd-fdt_blob, node,
 + COMPAT_NVIDIA_TEGRA20_SLINK);
 +   if (!node)
 +   break;

 I think you should be using fdtdec_find_aliases_for_id() so that aliases 
 work.

 I strongly believe we shouldn't be using aliases for enumeration, which
 is what fdtdec_find_aliases_for_id() does, IIRC. Instead, we should
 enumerate all the devices in the correct fashion, and then apply aliases
 as a separate step if they exists. Hence, I believe it's not correct to
 use fdtdec_find_aliases_for_id() anywhere.

We might be saying the same thing, but I can't tell. We had quite a
long discussion about this when the function was written and I thought
it was then considered correct.

The function does not ignore nodes without an alias. It simply returns
a list of nodes that your driver should init, in the order in which
U-Boot expects to find them. So I think it is safe to call, and in
fact should be called in any driver that has more than one device and
wants to provide the ability to select device ordering. Please can you
take another look at the function and see what you think?

We should not enumerate devices that are not supposed to be used, so
checking fdtdec_get_is_enabled() might be good too.

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


Re: [U-Boot] [PATCH] Tegra: T20: Remove unused 'SLOW' SoC ID and PLLX table entry

2013-01-22 Thread Simon Glass
On Fri, Jan 18, 2013 at 1:11 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 Signed-off-by: Tom Warren twar...@nvidia.com

Acked-by: Simon Glass s...@chromium.org

 ---
  arch/arm/cpu/arm720t/tegra-common/cpu.c |7 ---
  arch/arm/include/asm/arch-tegra/tegra.h |1 -
  2 files changed, 0 insertions(+), 8 deletions(-)

 diff --git a/arch/arm/cpu/arm720t/tegra-common/cpu.c 
 b/arch/arm/cpu/arm720t/tegra-common/cpu.c
 index 693d584..c32925b 100644
 --- a/arch/arm/cpu/arm720t/tegra-common/cpu.c
 +++ b/arch/arm/cpu/arm720t/tegra-common/cpu.c
 @@ -75,13 +75,6 @@ struct clk_pll_table 
 tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
  { 700, 6, 0, 8},
  { 700, 13, 0, 8},
 },
 -
 -   /* TEGRA_SOC2_SLOW: 312 MHz */
 -   {{ 312, 13, 0, 12}, /* OSC 13M */
 -{ 260, 16, 0, 8},  /* OSC 19.2M */
 -{ 312, 12, 0, 12}, /* OSC 12M */
 -{ 312, 26, 0, 12}, /* OSC 26M */
 -   },
  };

  void adjust_pllp_out_freqs(void)
 diff --git a/arch/arm/include/asm/arch-tegra/tegra.h 
 b/arch/arm/include/asm/arch-tegra/tegra.h
 index 953936c..013a3c5 100644
 --- a/arch/arm/include/asm/arch-tegra/tegra.h
 +++ b/arch/arm/include/asm/arch-tegra/tegra.h
 @@ -85,7 +85,6 @@ enum {
 TEGRA_SOC_T20,
 TEGRA_SOC_T25,
 TEGRA_SOC_T30,
 -   TEGRA_SOC2_SLOW,/* T2x needs to run at slow clock initially */

 TEGRA_SOC_CNT,
 TEGRA_SOC_UNKNOWN   = -1,
 --
 1.7.0.4

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


Re: [U-Boot] [PATCH 2/2] video: exynos_fb: Make a call to draw_logo only when CONFIG_CMD_BMP is selected

2013-01-22 Thread Ajay kumar
Hi Simon,

On Tue, Jan 22, 2013 at 7:13 PM, Simon Glass s...@chromium.org wrote:
 Hi Ajay,

 On Mon, Jan 14, 2013 at 1:32 AM, Ajay Kumar ajaykumar...@samsung.com wrote:
 Previously, the call to draw_logo() was happening irrespective
 of whether we have selected logo or LCD console.
 With this patch we call draw_logo() only when CONFIG_CMD_BMP is selected.

 This would even fix the following compilation warning:
 exynos_fb.c: In function 'draw_logo':
 exynos_fb.c:74:8: warning: variable 'addr' set but not used
 [-Wunused-but-set-variable]
 exynos_fb.c:73:9: warning: variable 'y' set but not used
 [-Wunused-but-set-variable]
 exynos_fb.c:73:6: warning: variable 'x' set but not used
 [-Wunused-but-set-variable]

 Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
 ---
  drivers/video/exynos_fb.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
 index 183bca0..ee0ed06 100644
 --- a/drivers/video/exynos_fb.c
 +++ b/drivers/video/exynos_fb.c
 @@ -68,6 +68,7 @@ static void exynos_lcd_init(vidinfo_t *vid)
 lcd_set_flush_dcache(1);
  }

 +#ifdef CONFIG_CMD_BMP
  static void draw_logo(void)
  {
 int x, y;
 @@ -88,10 +89,9 @@ static void draw_logo(void)
 }

 addr = panel_info.logo_addr;
 -#ifdef CONFIG_CMD_BMP
 bmp_display(addr, x, y);
 -#endif
  }
 +#endif

  static void lcd_panel_on(vidinfo_t *vid)
  {
 @@ -150,7 +150,9 @@ void lcd_enable(void)
 if (panel_info.logo_on) {
 memset(lcd_base, 0, panel_width * panel_height *
 (NBITS(panel_info.vl_bpix)  3));
 +#ifdef CONFIG_CMD_BMP
 draw_logo();
 +#endif

 It would be nice to avoid another #ifdef. Would it be possible instead
 to make the first #ifdef cover the whole internals of the draw_logo()
 function?
This patchset has already been merged!

 }

 lcd_panel_on(panel_info);
 --
 1.8.0


 Regards,
 Simon

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


Re: [U-Boot] [PATCH v2] arm: fix CONFIG_DELAY_ENVIRONMENT to act like it claims in the README

2013-01-22 Thread Simon Glass
On Tue, Jan 22, 2013 at 2:15 AM, Lucas Stach d...@lynxeye.de wrote:
 No one expects to end up in a delayed environment if
 CONFIG_DELAY_ENVIRONMENT isn't defined.

 Signed-off-by: Lucas Stach d...@lynxeye.de

Good with me, and solves the immediate problem. Thanks for doing the patch.

Acked-by: Simon Glass s...@chromium.org

 ---
 v2: keep preference of CONFIG_OF_CONTROL and just change default value
 ---
  arch/arm/lib/board.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
 index cfe32cc..9f861cc 100644
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 @@ -488,7 +488,7 @@ static char *failed = *** failed ***\n;
  static int should_load_env(void)
  {
  #ifdef CONFIG_OF_CONTROL
 -   return fdtdec_get_config_int(gd-fdt_blob, load-environment, 0);
 +   return fdtdec_get_config_int(gd-fdt_blob, load-environment, 1);
  #elif defined CONFIG_DELAY_ENVIRONMENT
 return 0;
  #else
 --
 1.8.0.2

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


Re: [U-Boot] [PATCH 2/2] video: exynos_fb: Make a call to draw_logo only when CONFIG_CMD_BMP is selected

2013-01-22 Thread Simon Glass
Hi Ajay,

On Tue, Jan 22, 2013 at 6:11 AM, Ajay kumar ajayn...@gmail.com wrote:
 Hi Simon,

 On Tue, Jan 22, 2013 at 7:13 PM, Simon Glass s...@chromium.org wrote:
 Hi Ajay,

 On Mon, Jan 14, 2013 at 1:32 AM, Ajay Kumar ajaykumar...@samsung.com wrote:
 Previously, the call to draw_logo() was happening irrespective
 of whether we have selected logo or LCD console.
 With this patch we call draw_logo() only when CONFIG_CMD_BMP is selected.

 This would even fix the following compilation warning:
 exynos_fb.c: In function 'draw_logo':
 exynos_fb.c:74:8: warning: variable 'addr' set but not used
 [-Wunused-but-set-variable]
 exynos_fb.c:73:9: warning: variable 'y' set but not used
 [-Wunused-but-set-variable]
 exynos_fb.c:73:6: warning: variable 'x' set but not used
 [-Wunused-but-set-variable]

 Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
 ---
  drivers/video/exynos_fb.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
 index 183bca0..ee0ed06 100644
 --- a/drivers/video/exynos_fb.c
 +++ b/drivers/video/exynos_fb.c
 @@ -68,6 +68,7 @@ static void exynos_lcd_init(vidinfo_t *vid)
 lcd_set_flush_dcache(1);
  }

 +#ifdef CONFIG_CMD_BMP
  static void draw_logo(void)
  {
 int x, y;
 @@ -88,10 +89,9 @@ static void draw_logo(void)
 }

 addr = panel_info.logo_addr;
 -#ifdef CONFIG_CMD_BMP
 bmp_display(addr, x, y);
 -#endif
  }
 +#endif

  static void lcd_panel_on(vidinfo_t *vid)
  {
 @@ -150,7 +150,9 @@ void lcd_enable(void)
 if (panel_info.logo_on) {
 memset(lcd_base, 0, panel_width * panel_height *
 (NBITS(panel_info.vl_bpix)  3));
 +#ifdef CONFIG_CMD_BMP
 draw_logo();
 +#endif

 It would be nice to avoid another #ifdef. Would it be possible instead
 to make the first #ifdef cover the whole internals of the draw_logo()
 function?
 This patchset has already been merged!

No problem - I have been away for a week and didn't see the 'applied' response.


 }

 lcd_panel_on(panel_info);
 --
 1.8.0


 Regards,
 Simon

 Regards,
 Ajay

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


[U-Boot] [PATCH 0/2] make u-boot/drivers/net/designware cache supportive

2013-01-22 Thread Frank Dols
Hello Vipin,
As discussed, see included the patches to make your
u-boot/drivers/net/designware Ethernet device driver cache support aware.
First patch is about: do an explicit memory access instead of implicit,
I re-written assignments to use readl() and writel().
Second patch is about: making the driver able to work in a cached environment
(do I$/D$ flush/invalidate where necessary).

Frank Dols (2):
  drivers/net/designware, do an explicit memory access instead of
implicit, re-written assignments to use readl() and writel(),  
  all of this as preperation for making the driver able to work in
a cached environment (I$D$ support).
  u-boot/drivers/net/designware with cache support.

 drivers/net/designware.c |  128 ++
 drivers/net/designware.h |4 +-
 2 files changed, 86 insertions(+), 46 deletions(-)

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


[U-Boot] [PATCH 2/2] u-boot/drivers/net/designware with cache support.

2013-01-22 Thread Frank Dols
Signed-off-by: Frank Dols frank.d...@synopsys.com
---
 drivers/net/designware.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 2f235d5..8e0508e 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -32,6 +32,9 @@
 #include linux/err.h
 #include asm/io.h
 #include designware.h
+#ifdef CONFIG_SYS_DCACHE_ON
+#include asm/cache.h
+#endif
 
 static int configure_phy(struct eth_device *dev);
 
@@ -227,6 +230,10 @@ static int dw_eth_send(struct eth_device *dev, void 
*packet, int length)
 
memcpy((void *)readl(desc_p-dmamac_addr), packet, length);
 
+#ifdef CONFIG_SYS_DCACHE_ON
+   flush_dcache_range((void *)readl(desc_p-dmamac_addr), length);
+#endif
+
 #if defined(CONFIG_DW_ALTDESCRIPTOR)
writel(readl(desc_p-txrx_status) | DESC_TXSTS_TXFIRST |
DESC_TXSTS_TXLAST, desc_p-txrx_status);
@@ -277,8 +284,17 @@ static int dw_eth_recv(struct eth_device *dev)
length = (status  DESC_RXSTS_FRMLENMSK) 
 DESC_RXSTS_FRMLENSHFT;
 
+#ifdef CONFIG_SYS_DCACHE_ON
+   invalidate_dcache_range((void *)readl(desc_p-dmamac_addr),
+   length);
+#endif
+
NetReceive(readl(desc_p-dmamac_addr), length);
 
+#ifdef CONFIG_SYS_DCACHE_ON
+   flush_dcache_range((void *)readl(desc_p-dmamac_addr), length);
+#endif
+
/*
 * Make the current descriptor valid again and go to
 * the next one
@@ -584,6 +600,10 @@ int designware_initialize(u32 id, ulong base_addr, u32 
phy_addr, u32 interface)
dev-halt = dw_eth_halt;
dev-write_hwaddr = dw_write_hwaddr;
 
+#ifdef CONFIG_SYS_DCACHE_ON
+   flush_dcache_range(priv, sizeof(struct dw_eth_dev));
+#endif
+
eth_register(dev);
 
 #if defined(CONFIG_MII)
-- 
1.7.0.4

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


[U-Boot] [PATCH 1/2] drivers/net/designware, do an explicit memory access instead of implicit, re-written assignments to use readl() and writel(), all of this as preperation for making the driver able

2013-01-22 Thread Frank Dols
Signed-off-by: Frank Dols frank.d...@synopsys.com
---
 drivers/net/designware.c |  108 +++---
 drivers/net/designware.h |4 +-
 2 files changed, 66 insertions(+), 46 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index bf21a08..2f235d5 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -44,29 +44,36 @@ static void tx_descs_init(struct eth_device *dev)
struct dmamacdescr *desc_p;
u32 idx;
 
+   txbuffs = (char *) unsigned long) txbuffs) +
+   CONFIG_SYS_CACHELINE_SIZE) 
+   (~(CONFIG_SYS_CACHELINE_SIZE - 1)));
+
for (idx = 0; idx  CONFIG_TX_DESCR_NUM; idx++) {
desc_p = desc_table_p[idx];
-   desc_p-dmamac_addr = txbuffs[idx * CONFIG_ETH_BUFSIZE];
-   desc_p-dmamac_next = desc_table_p[idx + 1];
+
+   writel((ulong)txbuffs[(idx * CONFIG_ETH_BUFSIZE)],
+   desc_p-dmamac_addr);
+   writel((ulong)desc_table_p[idx + 1], desc_p-dmamac_next);
 
 #if defined(CONFIG_DW_ALTDESCRIPTOR)
-   desc_p-txrx_status = ~(DESC_TXSTS_TXINT | DESC_TXSTS_TXLAST |
-   DESC_TXSTS_TXFIRST | DESC_TXSTS_TXCRCDIS | \
-   DESC_TXSTS_TXCHECKINSCTRL | \
-   DESC_TXSTS_TXRINGEND | DESC_TXSTS_TXPADDIS);
-
-   desc_p-txrx_status |= DESC_TXSTS_TXCHAIN;
-   desc_p-dmamac_cntl = 0;
-   desc_p-txrx_status = ~(DESC_TXSTS_MSK | DESC_TXSTS_OWNBYDMA);
+   writel(readl(desc_p-txrx_status)  ~(DESC_TXSTS_TXINT |
+   DESC_TXSTS_TXLAST | DESC_TXSTS_TXFIRST |
+   DESC_TXSTS_TXCRCDIS | DESC_TXSTS_TXCHECKINSCTRL |
+   DESC_TXSTS_TXRINGEND | DESC_TXSTS_TXPADDIS),
+   desc_p-txrx_status);
+   writel(readl(desc_p-txrx_status) | DESC_TXSTS_TXCHAIN,
+   desc_p-txrx_status);
+   writel(0, desc_p-dmamac_cntl);
+   writel(readl(desc_p-txrx_status)  ~(DESC_TXSTS_MSK |
+   DESC_TXSTS_OWNBYDMA), desc_p-txrx_status);
 #else
-   desc_p-dmamac_cntl = DESC_TXCTRL_TXCHAIN;
-   desc_p-txrx_status = 0;
+   writel(DESC_TXCTRL_TXCHAIN, desc_p-dmamac_cntl);
+   writel(0, desc_p-txrx_status);
 #endif
}
 
/* Correcting the last pointer of the chain */
-   desc_p-dmamac_next = desc_table_p[0];
-
+   writel((ulong)desc_table_p[0], desc_p-dmamac_next);
writel((ulong)desc_table_p[0], dma_p-txdesclistaddr);
 }
 
@@ -79,21 +86,23 @@ static void rx_descs_init(struct eth_device *dev)
struct dmamacdescr *desc_p;
u32 idx;
 
+   rxbuffs = (char *) unsigned long) rxbuffs) +
+   CONFIG_SYS_CACHELINE_SIZE) 
+   (~(CONFIG_SYS_CACHELINE_SIZE - 1)));
+
for (idx = 0; idx  CONFIG_RX_DESCR_NUM; idx++) {
desc_p = desc_table_p[idx];
-   desc_p-dmamac_addr = rxbuffs[idx * CONFIG_ETH_BUFSIZE];
-   desc_p-dmamac_next = desc_table_p[idx + 1];
 
-   desc_p-dmamac_cntl =
-   (MAC_MAX_FRAME_SZ  DESC_RXCTRL_SIZE1MASK) | \
- DESC_RXCTRL_RXCHAIN;
-
-   desc_p-txrx_status = DESC_RXSTS_OWNBYDMA;
+   writel((ulong)rxbuffs[idx * CONFIG_ETH_BUFSIZE],
+   desc_p-dmamac_addr);
+   writel((ulong)desc_table_p[idx + 1], desc_p-dmamac_next);
+   writel((MAC_MAX_FRAME_SZ  DESC_RXCTRL_SIZE1MASK) |
+   DESC_RXCTRL_RXCHAIN, desc_p-dmamac_cntl);
+   writel(DESC_RXSTS_OWNBYDMA, desc_p-txrx_status);
}
 
/* Correcting the last pointer of the chain */
-   desc_p-dmamac_next = desc_table_p[0];
-
+   writel((ulong)desc_table_p[0], desc_p-dmamac_next);
writel((ulong)desc_table_p[0], dma_p-rxdesclistaddr);
 }
 
@@ -134,7 +143,7 @@ static int dw_write_hwaddr(struct eth_device *dev)
u32 macid_lo, macid_hi;
u8 *mac_id = dev-enetaddr[0];
 
-   macid_lo = mac_id[0] + (mac_id[1]  8) + \
+   macid_lo = mac_id[0] + (mac_id[1]  8) +
   (mac_id[2]  16) + (mac_id[3]  24);
macid_hi = mac_id[4] + (mac_id[5]  8);
 
@@ -198,7 +207,6 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 */
writel(readl(dma_p-opmode) | RXSTART, dma_p-opmode);
writel(readl(dma_p-opmode) | TXSTART, dma_p-opmode);
-
writel(readl(mac_p-conf) | RXENABLE | TXENABLE, mac_p-conf);
 
return 0;
@@ -212,26 +220,27 @@ static int dw_eth_send(struct eth_device *dev, void 
*packet, int length)
struct dmamacdescr *desc_p = priv-tx_mac_descrtable[desc_num];
 
/* Check if the descriptor is owned by CPU */
-   if (desc_p-txrx_status  DESC_TXSTS_OWNBYDMA) {
+   if 

Re: [U-Boot] [PATCH v2] mx6qsabre_common: Let mmc partition be board specific

2013-01-22 Thread Fabio Estevam
Hi Stefano,

On Mon, Jan 14, 2013 at 4:59 PM, Fabio Estevam feste...@gmail.com wrote:
 From: Fabio Estevam fabio.este...@freescale.com

 commit 49ea0ff5 (49ea0ff5) introduced CONFIG_SYS_MMC_ENV_PART into 
 mx6qsabresd.h
 to store the mmc partition, but in order for it to have effect we should place
 it into 'mmcpart' variable.

 Also add CONFIG_SYS_MMC_ENV_PART into mx6qsabreauto.h.

 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
 Changes since v1:
 - Drop duplicated mmcpart
  include/configs/mx6qsabre_common.h |2 +-
  include/configs/mx6qsabreauto.h|1 +
  2 files changed, 2 insertions(+), 1 deletion(-)

Does this one look good now?

Thanks,

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


Re: [U-Boot] [PATCH 1/7] EXYNOS5: Add function to enable XXTI clock source

2013-01-22 Thread Simon Glass
Hi Rajeshwari,

On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch adds funtion to enable XXTI clock source
 required by MAX98095 codec.

 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  arch/arm/cpu/armv7/exynos/power.c|   11 +++
  arch/arm/include/asm/arch-exynos/power.h |   10 ++
  2 files changed, 21 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/cpu/armv7/exynos/power.c 
 b/arch/arm/cpu/armv7/exynos/power.c
 index 8572cfd..8de30c1 100644
 --- a/arch/arm/cpu/armv7/exynos/power.c
 +++ b/arch/arm/cpu/armv7/exynos/power.c
 @@ -105,3 +105,14 @@ void power_ps_hold_setup(void)
 setbits_le32(power-ps_hold_control,
 EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
  }
 +
 +
 +void power_enable_xclkout(void)
 +{
 +   struct exynos5_power *power =
 +   (struct exynos5_power *)samsung_get_base_power();
 +
 +   /* use xxti for xclk out */
 +   clrsetbits_le32(power-pmu_debug, PMU_DEBUG_CLKOUT_SEL_MASK,
 +   PMU_DEBUG_XXTI);
 +}
 diff --git a/arch/arm/include/asm/arch-exynos/power.h 
 b/arch/arm/include/asm/arch-exynos/power.h
 index 85e2cd9..f0eab16 100644
 --- a/arch/arm/include/asm/arch-exynos/power.h
 +++ b/arch/arm/include/asm/arch-exynos/power.h
 @@ -872,4 +872,14 @@ void set_dp_phy_ctrl(unsigned int enable);
   * (e.g. power button).
   */
  void power_ps_hold_setup(void);
 +
 +/* PMU_DEBUG bits [12:8] = 0x1000 selects XXTI
 + * clock source */
 +#define PMU_DEBUG_XXTI  0x1000
 +/* Mask bit[12:8] for xxti clock selection */
 +#define PMU_DEBUG_CLKOUT_SEL_MASK   0x1f00
 +
 +/* pmu debug is used for xclkout, enable xclkout with
 + * source as XXTI */

Multi-line comment style?

 +void power_enable_xclkout(void);
  #endif
 --
 1.7.4.4


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


Re: [U-Boot] [PATCH 4/7] EXYNOS5: GPIO to enable MAX98095

2013-01-22 Thread Simon Glass
Hi Rajeshwari,

On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch sets high a GPIO to enable the codec MAX98095

 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  board/samsung/smdk5250/smdk5250.c |   15 +++
  1 files changed, 15 insertions(+), 0 deletions(-)

 diff --git a/board/samsung/smdk5250/smdk5250.c 
 b/board/samsung/smdk5250/smdk5250.c
 index 12cc03e..6f2e067 100644
 --- a/board/samsung/smdk5250/smdk5250.c
 +++ b/board/samsung/smdk5250/smdk5250.c
 @@ -56,6 +56,18 @@ int board_usb_vbus_init(void)
  }
  #endif

 +#ifdef CONFIG_SOUND_MAX98095
 +static void  board_enable_audio_codec(void)
 +{
 +   struct exynos5_gpio_part1 *gpio1 = (struct exynos5_gpio_part1 *)
 +   samsung_get_base_gpio_part1();
 +
 +   /* Enable MAX98095 Codec */
 +   s5p_gpio_direction_output(gpio1-x1, 7, 1);
 +   s5p_gpio_set_pull(gpio1-x1, 7, GPIO_PULL_NONE);

This GPIO is hard-coded - does the FDT version of this file do this differently?

 +}
 +#endif
 +
  int board_init(void)
  {
 gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 @@ -65,6 +77,9 @@ int board_init(void)
  #ifdef CONFIG_USB_EHCI_EXYNOS
 board_usb_vbus_init();
  #endif
 +#ifdef CONFIG_SOUND_MAX98095
 +   board_enable_audio_codec();
 +#endif
 return 0;
  }

 --
 1.7.4.4


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


Re: [U-Boot] [PATCH 6/7] EXYNOS5: Add initial DTS file for Snow.

2013-01-22 Thread Simon Glass
On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch adds the DTS file for Snow Board.

 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com

Rajeshwari

 ---
  board/samsung/dts/exynos5250-snow.dts |   69 
 +
  1 files changed, 69 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/dts/exynos5250-snow.dts

 diff --git a/board/samsung/dts/exynos5250-snow.dts 
 b/board/samsung/dts/exynos5250-snow.dts
 new file mode 100644
 index 000..af788a6
 --- /dev/null
 +++ b/board/samsung/dts/exynos5250-snow.dts
 @@ -0,0 +1,69 @@
 +/*
 + * SAMSUNG SMDK5250 board device tree source
 + *
 + * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 + * http://www.samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 +*/
 +
 +/dts-v1/;
 +/include/ ARCH_CPU_DTS
 +
 +/ {
 +   model = Google Snow;
 +   compatible = google,snow, samsung,exynos5250;
 +
 +   aliases {
 +   i2c0 = /i2c@12c6;
 +   i2c1 = /i2c@12c7;
 +   i2c2 = /i2c@12c8;
 +   i2c3 = /i2c@12c9;
 +   i2c4 = /i2c@12ca;
 +   i2c5 = /i2c@12cb;
 +   i2c6 = /i2c@12cc;
 +   i2c7 = /i2c@12cd;
 +   spi0 = /spi@12d2;
 +   spi1 = /spi@12d3;
 +   spi2 = /spi@12d4;
 +   spi3 = /spi@131a;
 +   spi4 = /spi@131b;
 +   };
 +
 +   sromc@1225 {
 +   bank = 1;
 +   srom-timing = 1 9 12 1 6 1 1;
 +   width = 2;
 +   lan@500 {
 +   compatible = smsc,lan9215, smsc,lan;
 +   reg = 0x500 0x100;
 +   phy-mode = mii;
 +   };
 +   };
 +
 +   sound@12d6 {
 +   samsung,i2s-epll-clock-frequency = 19200;
 +   samsung,i2s-sampling-rate = 48000;
 +   samsung,i2s-bits-per-sample = 16;
 +   samsung,i2s-channels = 2;
 +   samsung,i2s-lr-clk-framesize = 256;
 +   samsung,i2s-bit-clk-framesize = 32;
 +   samsung,codec-type = max98095;
 +   };
 +
 +   i2c@12cd {
 +   soundcodec@22 {
 +   reg = 0x22;
 +   compatible = maxim,max98095-codec;
 +   };
 +   };
 +
 +   i2c@12c6 {
 +   pmic@9 {
 +   reg = 0x9;
 +   compatible = maxim,max77686_pmic;
 +   };
 +   };
 +};
 --
 1.7.4.4

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


Re: [U-Boot] [PATCH 7/7] EXYNOS5: Snow: Add a configuration file

2013-01-22 Thread Simon Glass
Hi Rajeshwari,

On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch adds the configuration file for Snow Board and
 defines the same in boards.cfg.
 The Audio codec required for SMDK5250 and Snow are different
 hence they are defined in the corresponding configuration files.

 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  boards.cfg  |1 +
  include/configs/exynos5250-dt.h |1 -
  include/configs/smdk5250.h  |1 +
  include/configs/snow.h  |   34 ++
  4 files changed, 36 insertions(+), 1 deletions(-)
  create mode 100644 include/configs/snow.h

 diff --git a/boards.cfg b/boards.cfg
 index e4b0d44..f247b03 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -283,6 +283,7 @@ s5p_goni arm armv7   goni 
samsung
  smdkc100 arm armv7   smdkc100
 samsungs5pc1xx
  origen  arm armv7   origen  
 samsungexynos
  s5pc210_universalarm armv7   universal_c210  
 samsungexynos
 +snowarm armv7   smdk5250
 samsungexynos
  smdk5250arm armv7   smdk5250
 samsungexynos
  smdkv310arm armv7   smdkv310
 samsungexynos
  tratsarm armv7   trats   
 samsungexynos
 diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
 index a01fb96..7b9c393 100644
 --- a/include/configs/exynos5250-dt.h
 +++ b/include/configs/exynos5250-dt.h
 @@ -297,7 +297,6 @@
  #ifdef CONFIG_CMD_SOUND
  #define CONFIG_SOUND
  #define CONFIG_I2S
 -#define CONFIG_SOUND_WM8994
  #endif

  /* Enable devicetree support */
 diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
 index 81f83a8..b23b5bc 100644
 --- a/include/configs/smdk5250.h
 +++ b/include/configs/smdk5250.h
 @@ -30,4 +30,5 @@
  #undef CONFIG_DEFAULT_DEVICE_TREE
  #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-smdk5250

 +#define CONFIG_SOUND_WM8994
  #endif /* __CONFIG_SMDK_H */
 diff --git a/include/configs/snow.h b/include/configs/snow.h
 new file mode 100644
 index 000..be38635
 --- /dev/null
 +++ b/include/configs/snow.h
 @@ -0,0 +1,34 @@
 +/*
 + * Copyright (C) 2012 Samsung Electronics
 + *
 + * Configuration settings for the SAMSUNG SMDK5250 board.
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#ifndef __CONFIG_SMDK_H
 +#define __CONFIG_SMDK_H
 +
 +#include configs/exynos5250-dt.h
 +
 +#undef CONFIG_DEFAULT_DEVICE_TREE
 +#define CONFIG_DEFAULT_DEVICE_TREE exynos5250-snow
 +
 +#define CONFIG_SOUND_MAX98095

Really it would be better if they could share the same config, with
just the CONFIG_DEFAULT_DEVICE_TREE difference. Isn't there code to
select the right codec based on the FDT nodes?

Maybe I have this wrong, not sure.

 +#endif /* __CONFIG_SMDK_H */
 --
 1.7.4.4


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


Re: [U-Boot] [PATCH v2] mx6qsabre_common: Let mmc partition be board specific

2013-01-22 Thread Stefano Babic
On 22/01/2013 15:42, Fabio Estevam wrote:
 Hi Stefano,
 

Hi Fabio,

 On Mon, Jan 14, 2013 at 4:59 PM, Fabio Estevam feste...@gmail.com wrote:
 From: Fabio Estevam fabio.este...@freescale.com

 commit 49ea0ff5 (49ea0ff5) introduced CONFIG_SYS_MMC_ENV_PART into 
 mx6qsabresd.h
 to store the mmc partition, but in order for it to have effect we should 
 place
 it into 'mmcpart' variable.

 Also add CONFIG_SYS_MMC_ENV_PART into mx6qsabreauto.h.

 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
 Changes since v1:
 - Drop duplicated mmcpart
  include/configs/mx6qsabre_common.h |2 +-
  include/configs/mx6qsabreauto.h|1 +
  2 files changed, 2 insertions(+), 1 deletion(-)
 
 Does this one look good now?

Yes, it is, it is in my queue for next merge.

Regards,
Stefano


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Custodians, Maintainers and old platforms

2013-01-22 Thread Detlev Zundel
Hi Marek,

[...]

 It brings me to another question though,
 would it be possible to get a custodian tree for OpenRISC?

 CCing Detlev.

Sorry for being late here - do we still need/want the OpenRISC tree?
Actually I anticipated such a tree  nearly five years ago[1] *lol*.

Cheers
  Detlev

[1] http://www.denx.de/wiki/view/U-Boot/CustodianGitTrees?rev=1.1

-- 
I'm sorry that I long ago coined the term objects for this topic
because it gets many people to focus on the lesser idea.
  -- Alan Kay on Object Oriented Programming
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/7 v5] EXYNOS5: TMU: Add driver for Thermal Management Unit

2013-01-22 Thread Simon Glass
Hi Akshay,

On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 Adding Exynos Thermal Management Unit driver to monitor SOC
 temperature and take actions corresponding to states of TMU.

 Signed-off-by: Akshay Saraswat aksha...@samsung.com

Acked-by: Simon Glass s...@chromium.org

See a few nits below in case you do a v5.

 ---
 Changes since v4:
 - Changed return value of get_cur_temp in case of 0 degree temp from 
 -1 to TMU_STATUS_INIT because return value should be enum tmu_status_t.

  arch/arm/include/asm/arch-exynos/exynos-tmu.h |   58 +
  drivers/power/Makefile|1 +
  drivers/power/exynos-tmu.c|  297 
 +
  include/tmu.h |   46 
  4 files changed, 402 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-exynos/exynos-tmu.h
  create mode 100644 drivers/power/exynos-tmu.c
  create mode 100644 include/tmu.h


 diff --git a/drivers/power/Makefile b/drivers/power/Makefile
 index 8c71901..a5c7027 100644
 --- a/drivers/power/Makefile
 +++ b/drivers/power/Makefile
 @@ -30,6 +30,7 @@ COBJS-$(CONFIG_TPS6586X_POWER)+= tps6586x.o
  COBJS-$(CONFIG_TWL4030_POWER)  += twl4030.o
  COBJS-$(CONFIG_TWL6030_POWER)  += twl6030.o
  COBJS-$(CONFIG_TWL6035_POWER)  += twl6035.o
 +COBJS-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o

Should be in alphabetical order by CONFIG name


  COBJS-$(CONFIG_POWER) += power_core.o
  COBJS-$(CONFIG_DIALOG_POWER) += power_dialog.o
 diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c
 new file mode 100644
 index 000..c48fe28
 --- /dev/null
 +++ b/drivers/power/exynos-tmu.c
 @@ -0,0 +1,297 @@
 +/*
 + * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 + *  http://www.samsung.com
 + * Akshay Saraswat aksha...@samsung.com
 + *
 + * EXYNOS - Thermal Management Unit
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#include common.h
 +#include errno.h
 +#include fdtdec.h
 +#include tmu.h
 +#include asm/arch/exynos-tmu.h
 +
 +#define TRIMINFO_RELOAD1
 +#define CORE_EN1
 +
 +#define INTEN_RISE01
 +#define INTEN_RISE1(1  4)
 +#define INTEN_RISE2(1  8)
 +#define INTEN_FALL0(1  16)
 +#define INTEN_FALL1(1  20)
 +#define INTEN_FALL2(1  24)
 +
 +#define TRIM_INFO_MASK 0xff
 +
 +#define INTCLEAR_RISE0 1
 +#define INTCLEAR_RISE1 (1  4)
 +#define INTCLEAR_RISE2 (1  8)
 +#define INTCLEAR_FALL0 (1  16)
 +#define INTCLEAR_FALL1 (1  20)
 +#define INTCLEAR_FALL2 (1  24)
 +#define INTCLEARALL(INTCLEAR_RISE0 | INTCLEAR_RISE1 | \
 +INTCLEAR_RISE2 | INTCLEAR_FALL0 | \
 +INTCLEAR_FALL1 | INTCLEAR_FALL2)
 +
 +/* Tmeperature threshold values for various thermal events */
 +struct temperature_params {
 +   /* minimum value in temperature code range */
 +   unsigned int min_val;
 +   /* maximum value in temperature code range */
 +   unsigned int max_val;
 +   /* temperature threshold to start warning */
 +   unsigned int start_warning;
 +   /* temperature threshold CPU tripping */
 +   unsigned int start_tripping;
 +};
 +
 +/* Pre-defined values and thresholds for calibration of current temperature 
 */
 +struct tmu_data {
 +   /* pre-defined temperature thresholds */
 +   struct temperature_params ts;
 +   /* pre-defined efuse range minimum value */
 +   unsigned int efuse_min_value;
 +   /* pre-defined efuse value for temperature calibration */
 +   unsigned int efuse_value;
 +   /* pre-defined efuse range maximum value */
 +   unsigned int efuse_max_value;
 +   /* current temperature sensing slope */
 +   unsigned int slope;
 +};
 +
 +/* TMU device specific details and status */
 +struct tmu_info {
 +   /* base Address for the TMU */
 +   unsigned tmu_base;
 +   /* mux Address for the TMU */
 +   int tmu_mux;
 +   /* pre-defined values for calibration and thresholds */
 +   struct tmu_data data;
 +   /* value required for triminfo_25 calibration */
 +   unsigned int te1;
 +   /* value required for triminfo_85 calibration */
 +   unsigned int te2;
 +   /* TMU DC value for threshold calculation */
 +   int dc_value;
 +   /* enum value indicating status of the TMU */
 +   int tmu_state;
 +};
 +
 +/* Global struct 

Re: [U-Boot] [PATCH 2/7 v5] EXYNOS5: Implement board_poweroff for Thermal Management Unit

2013-01-22 Thread Simon Glass
On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 Adding API in power for system shutdown when tripping value is reached
 in Exynos Thermal Management Unit.

 Signed-off-by: Akshay Saraswat aksha...@samsung.com

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes since v4:
 - Changed API name from power_shutdown to generic board_poweroff 
 defined in commomn.h.

  arch/arm/cpu/armv7/exynos/power.c|   15 +++
  arch/arm/include/asm/arch-exynos/power.h |1 +
  2 files changed, 16 insertions(+)

 diff --git a/arch/arm/cpu/armv7/exynos/power.c 
 b/arch/arm/cpu/armv7/exynos/power.c
 index d4bce6d..1d26982 100644
 --- a/arch/arm/cpu/armv7/exynos/power.c
 +++ b/arch/arm/cpu/armv7/exynos/power.c
 @@ -95,3 +95,18 @@ void set_dp_phy_ctrl(unsigned int enable)
 if (cpu_is_exynos5())
 exynos5_dp_phy_control(enable);
  }
 +
 +/*
 + * This function never returns.
 + * When called this function makes system hang and PAD driving value high
 + * which in turn makes system power down.
 + */
 +void board_poweroff(void)
 +{
 +   struct exynos5_power *power =
 +   (struct exynos5_power *)samsung_get_base_power();
 +
 +   clrbits_le32(power-ps_hold_control, 
 POWER_PS_HOLD_CONTROL_DATA_HIGH);
 +
 +   hang();
 +}
 diff --git a/arch/arm/include/asm/arch-exynos/power.h 
 b/arch/arm/include/asm/arch-exynos/power.h
 index d2fdb59..7463036 100644
 --- a/arch/arm/include/asm/arch-exynos/power.h
 +++ b/arch/arm/include/asm/arch-exynos/power.h
 @@ -863,5 +863,6 @@ void set_usbhost_phy_ctrl(unsigned int enable);
  void set_dp_phy_ctrl(unsigned int enable);

  #define EXYNOS_DP_PHY_ENABLE   (1  0)
 +#define POWER_PS_HOLD_CONTROL_DATA_HIGH (1  8)

  #endif
 --
 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 3/7 v5] EXYNOS5: FDT: Add TMU device node values

2013-01-22 Thread Simon Glass
Hi Akshay,

On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 Fdt entry for Exynos TMU driver specific pre-defined values used for
 calibration of current temperature and defining threshold values.

 Signed-off-by: Akshay Saraswat aksha...@samsung.com

With nits below fixed

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes since v4:
 - Rebased this patch.

  arch/arm/dts/exynos5250.dtsi  |5 +
  board/samsung/dts/exynos5250-smdk5250.dts |   13 +++
  doc/device-tree-bindings/exynos/tmu.txt   |   35 
 +
  include/fdtdec.h  |1 +
  lib/fdtdec.c  |1 +
  5 files changed, 55 insertions(+)
  create mode 100644 doc/device-tree-bindings/exynos/tmu.txt

 diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
 index ed8c8dd..b2ef42e 100644
 --- a/arch/arm/dts/exynos5250.dtsi
 +++ b/arch/arm/dts/exynos5250.dtsi
 @@ -151,4 +151,9 @@
 };
 };

 +   tmu@1006 {
 +   compatible = samsung,exynos-tmu;
 +   reg = 0x1006 0x;

The size should be 0x1 I think.

 +   };
 +
  };
 diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
 b/board/samsung/dts/exynos5250-smdk5250.dts
 index cbfab6f..f49ca44 100644
 --- a/board/samsung/dts/exynos5250-smdk5250.dts
 +++ b/board/samsung/dts/exynos5250-smdk5250.dts
 @@ -66,4 +66,17 @@
 compatible = maxim,max77686_pmic;
 };
 };
 +
 +   tmu@1006 {
 +   samsung,mux = 6;
 +   samsung,min-temp= 25;
 +   samsung,max-temp= 125;
 +   samsung,start-warning   = 95;
 +   samsung,start-tripping  = 105;
 +   samsung,efuse-min-value = 40;
 +   samsung,efuse-value = 55;
 +   samsung,efuse-max-value = 100;
 +   samsung,slope   = 268470274;
 +   samsung,dc-value= 25;
 +   };
  };
 diff --git a/doc/device-tree-bindings/exynos/tmu.txt 
 b/doc/device-tree-bindings/exynos/tmu.txt
 new file mode 100644
 index 000..ed1e22a
 --- /dev/null
 +++ b/doc/device-tree-bindings/exynos/tmu.txt
 @@ -0,0 +1,35 @@
 +Exynos Thermal management Unit
 +
 +The device node for TMU that is a part of Exynos5250
 +SOC is as described in the document Open Firmware Recommended
 +Practic : Universal Serial Bus with the following modifications

Practice

 +and additions:
 +
 +Required properties :
 + - compatible : Should be samsung,exynos-tmu for TMU
 + - samsung,mux : mux Address for the TMU to enable TMU core

This doesn't make a lot of sense - can you expand this comment a bit
so people know what value to use?

 + - samsung,min-temp : Minimum temperature, default is 25
 + - samsung,max-temp : Maximum temperature, defalut set to 125
 + - samsung,start-warning : temp at which TMU start giving warning
 + - samsung,start-tripping : temp at which system will trip and shutdown
 + - samsung,efuse-min-value : SOC efuse min value
 + - samsung,efuse-value : SOC actual efuse value
 + - samsung,efuse-max-value : SoC max efuse value
 + - samsung,slope : Gain of amplifier, default is 268470274

What are the units for this value?

 + - samsung,dc-value : DC value of TMU, default is 25
 +
 +Example:
 +
 +tmu@1006 {
 +   compatible = samsung,exynos-tmu
 +   samsung,mux = 6;
 +   samsung,min-temp = 25;
 +   samsung,max-temp = 125;
 +   samsung,start-warning = 95;
 +   samsung,start-tripping = 105;
 +   samsung,efuse-min-value = 40;
 +   samsung,efuse-value = 55;
 +   samsung,efuse-max-value = 100;
 +   samsung,slope = 268470274;
 +   samsung,dc-value = 25;
 +};
 diff --git a/include/fdtdec.h b/include/fdtdec.h
 index f77d195..058fb51 100644
 --- a/include/fdtdec.h
 +++ b/include/fdtdec.h
 @@ -79,6 +79,7 @@ enum fdt_compat_id {
 COMPAT_SAMSUNG_EXYNOS_EHCI, /* Exynos EHCI controller */
 COMPAT_SAMSUNG_EXYNOS_USB_PHY,  /* Exynos phy controller for usb2.0 */
 COMPAT_MAXIM_MAX77686_PMIC, /* MAX77686 PMIC */
 +   COMPAT_SAMSUNG_EXYNOS_TMU,  /* Exynos TMU */

 COMPAT_COUNT,
  };
 diff --git a/lib/fdtdec.c b/lib/fdtdec.c
 index 16921e1..4613fcd 100644
 --- a/lib/fdtdec.c
 +++ b/lib/fdtdec.c
 @@ -54,6 +54,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 COMPAT(SAMSUNG_EXYNOS_EHCI, samsung,exynos-ehci),
 COMPAT(SAMSUNG_EXYNOS_USB_PHY, samsung,exynos-usb-phy),
 COMPAT(MAXIM_MAX77686_PMIC, maxim,max77686_pmic),
 +   COMPAT(SAMSUNG_EXYNOS_TMU, samsung,exynos-tmu),
  };

  const char *fdtdec_get_compatible(enum fdt_compat_id id)
 --
 1.7.9.5


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


[U-Boot] [PATCH 2/2] tegra: rename FUNCMUX_UART2_UARTB

2013-01-22 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

FUNCMUX_ defines should be named after the pin groups they affect, not
after the module they're muxing onto those pin groups.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
 arch/arm/cpu/tegra-common/board.c   |4 ++--
 arch/arm/cpu/tegra20-common/funcmux.c   |2 +-
 arch/arm/include/asm/arch-tegra20/funcmux.h |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/tegra-common/board.c 
b/arch/arm/cpu/tegra-common/board.c
index 1ec6c06..15ac0c5 100644
--- a/arch/arm/cpu/tegra-common/board.c
+++ b/arch/arm/cpu/tegra-common/board.c
@@ -112,8 +112,8 @@ static int uart_configs[] = {
FUNCMUX_UART1_SDIO1,
  #else
FUNCMUX_UART1_IRRX_IRTX,
- #endif
-   FUNCMUX_UART2_UARTB,
+#endif
+   FUNCMUX_UART2_UAD,
-1,
FUNCMUX_UART4_GMC,
-1,
diff --git a/arch/arm/cpu/tegra20-common/funcmux.c 
b/arch/arm/cpu/tegra20-common/funcmux.c
index a1c55a6..80a9bd9 100644
--- a/arch/arm/cpu/tegra20-common/funcmux.c
+++ b/arch/arm/cpu/tegra20-common/funcmux.c
@@ -98,7 +98,7 @@ int funcmux_select(enum periph_id id, int config)
break;
 
case PERIPH_ID_UART2:
-   if (config == FUNCMUX_UART2_UARTB) {
+   if (config == FUNCMUX_UART2_UAD) {
pinmux_set_func(PINGRP_UAD, PMUX_FUNC_UARTB);
pinmux_tristate_disable(PINGRP_UAD);
}
diff --git a/arch/arm/include/asm/arch-tegra20/funcmux.h 
b/arch/arm/include/asm/arch-tegra20/funcmux.h
index 963f021..7f15bce 100644
--- a/arch/arm/include/asm/arch-tegra20/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra20/funcmux.h
@@ -35,7 +35,7 @@ enum {
FUNCMUX_UART1_UAA_UAB,
FUNCMUX_UART1_GPU,
FUNCMUX_UART1_SDIO1,
-   FUNCMUX_UART2_UARTB = 0,
+   FUNCMUX_UART2_UAD = 0,
FUNCMUX_UART4_GMC = 0,
 
/* I2C configs */
-- 
1.7.10.4

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


[U-Boot] [PATCH 1/2] tegra: don't hard-code LCD into default TEGRA_DEVICE_SETTINGS

2013-01-22 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

Only add lcd into TEGRA_DEVICE_SETTINGS if CONFIG_VIDEO_TEGRA.
Otherwise, lcd is meaningless.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
 include/configs/tegra-common-post.h |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/configs/tegra-common-post.h 
b/include/configs/tegra-common-post.h
index 74bebb7..f2a70b1 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -133,10 +133,17 @@
 #define STDIN_KBD_USB 
 #endif
 
+#ifdef CONFIG_VIDEO_TEGRA
+#define STDOUT_LCD ,lcd
+#else
+#define STDOUT_LCD 
+#endif
+
 #define TEGRA_DEVICE_SETTINGS \
stdin=serial STDIN_KBD_KBC STDIN_KBD_USB \0 \
-   stdout=serial,lcd\0 \
-   stderr=serial,lcd\0 \
+   stdout=serial STDOUT_LCD \0 \
+   stderr=serial STDOUT_LCD \0 \
+   
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
TEGRA_DEVICE_SETTINGS \
-- 
1.7.10.4

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


[U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

This selects the safe (non-conflicting) mux function for a pin group
if the current setting matches the specified function.

Many signals can be routed to or from multiple different groups. Each
signal must be routed to or from only a single group at a given time.
Hence, if we program a particular group for a function, we must ensure
no other group is programmed to that same function first. This API
makes this easy.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
This patch will need updating due to the recently added Tegra30 support.
However, I'm posting it for Lucas, since his NAND patches can probably
benefit from this.

 arch/arm/cpu/tegra20-common/pinmux.c   |   23 +++
 arch/arm/include/asm/arch-tegra20/pinmux.h |6 ++
 2 files changed, 29 insertions(+)

diff --git a/arch/arm/cpu/tegra20-common/pinmux.c 
b/arch/arm/cpu/tegra20-common/pinmux.c
index 5ad2121..47179f3 100644
--- a/arch/arm/cpu/tegra20-common/pinmux.c
+++ b/arch/arm/cpu/tegra20-common/pinmux.c
@@ -554,6 +554,29 @@ void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func 
func)
writel(reg, muxctl);
 }
 
+static enum pmux_func pinmux_get_func(enum pmux_pingrp pin)
+{
+   struct pmux_tri_ctlr *pmt =
+   (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
+   enum pmux_ctlid mux_id = tegra_soc_pingroups[pin].ctl_id;
+   u32 *muxctl = pmt-pmt_ctl[MUXCTL_REG(mux_id)];
+   u32 reg;
+
+   reg = readl(muxctl);
+   reg = MUXCTL_SHIFT(mux_id);
+   reg = 3;
+
+   return tegra_soc_pingroups[pin].funcs[reg];
+}
+
+void pinmux_avoid_func(enum pmux_pingrp pin, enum pmux_func avoid)
+{
+   if (pinmux_get_func(pin) != avoid)
+   return;
+
+   pinmux_set_func(pin, tegra_soc_pingroups[pin].func_safe);
+}
+
 void pinmux_config_pingroup(const struct pingroup_config *config)
 {
enum pmux_pingrp pin = config-pingroup;
diff --git a/arch/arm/include/asm/arch-tegra20/pinmux.h 
b/arch/arm/include/asm/arch-tegra20/pinmux.h
index a9b4eda..d36e18e 100644
--- a/arch/arm/include/asm/arch-tegra20/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra20/pinmux.h
@@ -337,6 +337,12 @@ void pinmux_set_pullupdown(enum pmux_pingrp pin, enum 
pmux_pull pupd);
 /* Set the mux function for a pin group */
 void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func);
 
+/*
+ * Select the safe (non-conflicting) mux function for a pin group if the
+ * current setting matches the specified function.
+ */
+void pinmux_avoid_func(enum pmux_pingrp pin, enum pmux_func func);
+
 /* Set the complete configuration for a pin group */
 void pinmux_config_pingroup(const struct pingroup_config *config);
 
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH] tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT

2013-01-22 Thread Stephen Warren
On 01/21/2013 05:20 PM, Lucas Stach wrote:
 Even the 8bit case needs KBCB configured, as pin D7 is located in this
 pingroup. Also pingroup ATC seems to come out of reset with config set
 to NAND, so we need to explictly configure some other function to this
 group in order to avoid clashing settings.

 diff --git a/arch/arm/cpu/tegra20-common/funcmux.c 
 b/arch/arm/cpu/tegra20-common/funcmux.c

 @@ -266,17 +266,25 @@ int funcmux_select(enum periph_id id, int config)
   break;
   case FUNCMUX_NDFLASH_KBC_8_BIT:
...
 + /*
 +  * configure pingroup ATC to something unrelated to
 +  * avoid ATC overriding KBC
 +  */
 + pinmux_set_func(PINGRP_ATC, PMUX_FUNC_GMI);
 +

This gets a bit dangerous; what if pingroup ATC was already configured
for some function other than NAND or GMI? This code will then break that
setting. I would suggest one of the following alternatives:

1) Use the new pinmux_avoid_func() function implemented in the patch
that I just sent.

2) Move Tegra20 over to the new board-wide pinmux style that Tegra30
uses, where the entire pinmux is initialized in one shot. This will
completely avoid any kind of uninitialized pinmux settings, and to some
extent is the only sensible thing to do on a device like Tegra which has
the potential for conflicts like this patch tries to avoid.

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


Re: [U-Boot] [PATCH v2 3/7] Tegra114: Add CPU (armv7) files

2013-01-22 Thread Simon Glass
On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 These files are for code that runs on the CPU (A15) on T114 boards.
 At this time, there is no A15-specific code here.
 As T114-specific run-time code is added, it'll go here.

 Signed-off-by: Tom Warren twar...@nvidia.com

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes in v2:
 - update all new copyright header dates to 2013

  arch/arm/cpu/armv7/tegra114/Makefile  |   40 
 +
  arch/arm/cpu/armv7/tegra114/config.mk |   19 +++
  2 files changed, 59 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/tegra114/Makefile
  create mode 100644 arch/arm/cpu/armv7/tegra114/config.mk

 diff --git a/arch/arm/cpu/armv7/tegra114/Makefile 
 b/arch/arm/cpu/armv7/tegra114/Makefile
 new file mode 100644
 index 000..eb98c8e
 --- /dev/null
 +++ b/arch/arm/cpu/armv7/tegra114/Makefile
 @@ -0,0 +1,40 @@
 +#
 +# Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
 +#
 +# (C) Copyright 2000-2003
 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 +#
 +# This program is free software; you can redistribute it and/or modify it
 +# under the terms and conditions of the GNU General Public License,
 +# version 2, as published by the Free Software Foundation.
 +#
 +# This program is distributed in the hope it will be useful, but WITHOUT
 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 +# more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see http://www.gnu.org/licenses/.
 +#
 +
 +include $(TOPDIR)/config.mk
 +
 +LIB= $(obj)lib$(SOC).o
 +
 +COBJS  := $(COBJS-y)
 +SRCS   := $(COBJS:.o=.c)
 +OBJS   := $(addprefix $(obj),$(COBJS))
 +
 +all:   $(obj).depend $(LIB)
 +
 +$(LIB):$(OBJS)
 +   $(call cmd_link_o_target, $(OBJS))
 +
 +#
 +
 +# defines $(obj).depend target
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 diff --git a/arch/arm/cpu/armv7/tegra114/config.mk 
 b/arch/arm/cpu/armv7/tegra114/config.mk
 new file mode 100644
 index 000..cb1a19d
 --- /dev/null
 +++ b/arch/arm/cpu/armv7/tegra114/config.mk
 @@ -0,0 +1,19 @@
 +#
 +# Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
 +#
 +# (C) Copyright 2002
 +# Gary Jennejohn, DENX Software Engineering, ga...@denx.de
 +#
 +# This program is free software; you can redistribute it and/or modify it
 +# under the terms and conditions of the GNU General Public License,
 +# version 2, as published by the Free Software Foundation.
 +#
 +# This program is distributed in the hope it will be useful, but WITHOUT
 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 +# more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see http://www.gnu.org/licenses/.
 +#
 +CONFIG_ARCH_DEVICE_TREE := tegra114
 --
 1.7.0.4

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


Re: [U-Boot] [PATCH v2 1/7] Tegra114: Add arch-tegra114 include files

2013-01-22 Thread Tom Warren
Stephen,

On Fri, Jan 18, 2013 at 4:54 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/18/2013 02:12 PM, Tom Warren wrote:
 Common Tegra files are in arch-tegra, shared between T20/T30/T114.
 Tegra114-specific headers are in arch-tegra114. Note that some of
 these will be filled in as more T114 support is added (drivers,
 WB/LP0 support, etc.).

 diff --git a/arch/arm/include/asm/arch-tegra/tegra.h 
 b/arch/arm/include/asm/arch-tegra/tegra.h
 index 013a3c5..2dbe6a3 100644
 --- a/arch/arm/include/asm/arch-tegra/tegra.h
 +++ b/arch/arm/include/asm/arch-tegra/tegra.h
 @@ -73,6 +73,7 @@ enum {
   SKU_ID_AP25E= 0x1b,
   SKU_ID_T25E = 0x1c,
   SKU_ID_T30  = 0x81, /* Cardhu value */
 + SKU_ID_T114 = 0x00, /* Dalmore value */

 I believe a SKU ID of 0 indicates an unfused or engineering part. I'll
 try to find the relevant email and forward it to you off-list. As such,
 I think it'll save us trouble in the future if you simply rename that
 SKU_ID_T114_UNFUSED/GENERIC/ENG/ENGINEERING to make it explicit what
 this means. You should probably talk to someone internally to confirm
 the best terminology to use here; probably whoever originally sent the
 email that I'll try to forward to you. I think you can make such a
 trivial symbol renaming change when you apply the patch, without
 reposting the patches, unless any other changes are needed.

I can change this to SKU_ID_T114_ENG. Would that be sufficient?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 00/10] common.lcd: remove globals and cleanup

2013-01-22 Thread Jeroen Hofstee
As mentioned in http://lists.denx.de/pipermail/u-boot/2013-January/143459.html
there does not seem to be a good reason why the frame buffer driver
provide the variables for the lcd internal logic. So lets just remove it.
If there is any good reason for a framebuffer driver to call up it should
do so by a function call and not change the lcd its internal state (and
there is actually none doing so at the moment).

This patchset first removes unused drivers and places drivers useing
common/lcd.c in drivers/video. Then removes the unneeded globals and
thereafter finishes with some cleanups.

This patch goes after http://patchwork.ozlabs.org/patch/209692/
common/lcd.c: cleanup use of global variables

Version 2:
 Marek Vasut ma...@denx.de: use format-patch -M to detect moves
 Adjust the commit message not to exceed the max line length
 Fix malformed email address.
 check-patch clean (adjusted a space in patch 6)
 remove bouncing email addresses and add acks
 patch 7 and 10 are unchanged and not reposted

Jeroen Hofstee (10):
  lcd, amba: remove this driver since it is not used
  lcd, tegra: remove unused cursor functions
  lcd, mpc8xx: move the mpc8xx driver to drivers/video
  lcd, pxafb: move the pxafb to drivers/video
  common/lcd.c: cleanup use of global variables
  common/lcd.c: remove global lcd_base
  common/lcd: cosmetic: clean up a bit
  lcd, fb: remove duplicated prototypes and unused code
  api/api_display: use the getters for console size info
  common/lcd.c: move the macro's to the c file

 api/api_display.c  |4 +-
 arch/arm/cpu/pxa/Makefile  |1 -
 arch/powerpc/cpu/mpc8xx/Makefile   |1 -
 board/mcc200/lcd.c |   21 +---
 common/lcd.c   |  117 +++-
 drivers/video/Makefile |3 +-
 drivers/video/amba.c   |   77 -
 drivers/video/atmel_hlcdfb.c   |8 --
 drivers/video/atmel_lcdfb.c|8 --
 drivers/video/exynos_fb.c  |   14 +--
 .../cpu/mpc8xx/lcd.c = drivers/video/mpc8xx_lcd.c |   58 +-
 .../arm/cpu/pxa/pxafb.c = drivers/video/pxa_lcd.c |   41 ---
 drivers/video/tegra.c  |   64 +--
 include/configs/R360MPI.h  |1 +
 include/configs/RBC823.h   |1 +
 include/configs/RPXlite_DW.h   |1 +
 include/configs/RRvision.h |4 +-
 include/configs/TQM823L.h  |1 +
 include/configs/TQM823M.h  |1 +
 include/configs/lubbock.h  |1 +
 include/configs/lwmon.h|1 +
 include/configs/palmld.h   |1 +
 include/configs/palmtc.h   |1 +
 include/configs/pxa255_idp.h   |1 +
 include/configs/svm_sc8xx.h|1 +
 include/configs/v37.h  |1 +
 include/configs/zipitz2.h  |1 +
 include/lcd.h  |   71 +++-
 28 files changed, 109 insertions(+), 396 deletions(-)
 delete mode 100644 drivers/video/amba.c
 rename arch/powerpc/cpu/mpc8xx/lcd.c = drivers/video/mpc8xx_lcd.c (92%)
 rename arch/arm/cpu/pxa/pxafb.c = drivers/video/pxa_lcd.c (93%)

--
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/10] lcd, tegra: remove unused cursor functions

2013-01-22 Thread Jeroen Hofstee
cc: Anatolij Gustschin ag...@denx.de
cc: Simon Glass s...@chromium.org
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 drivers/video/tegra.c |   52 -
 1 file changed, 52 deletions(-)

diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index 3709d0b..26a96a5 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -73,62 +73,10 @@ vidinfo_t panel_info = {
.vl_col = -1,
 };
 
-char lcd_cursor_enabled;
-
-ushort lcd_cursor_width;
-ushort lcd_cursor_height;
-
 #ifndef CONFIG_OF_CONTROL
 #error You must enable CONFIG_OF_CONTROL to get Tegra LCD support
 #endif
 
-void lcd_cursor_size(ushort width, ushort height)
-{
-   lcd_cursor_width = width;
-   lcd_cursor_height = height;
-}
-
-void lcd_toggle_cursor(void)
-{
-   ushort x, y;
-   uchar *dest;
-   ushort row;
-
-   x = console_col * lcd_cursor_width;
-   y = console_row * lcd_cursor_height;
-   dest = (uchar *)(lcd_base + y * lcd_line_length + x * (1  LCD_BPP) /
-   8);
-
-   for (row = 0; row  lcd_cursor_height; ++row, dest += lcd_line_length) {
-   ushort *d = (ushort *)dest;
-   ushort color;
-   int i;
-
-   for (i = 0; i  lcd_cursor_width; ++i) {
-   color = *d;
-   color ^= lcd_getfgcolor();
-   *d = color;
-   ++d;
-   }
-   }
-}
-
-void lcd_cursor_on(void)
-{
-   lcd_cursor_enabled = 1;
-   lcd_toggle_cursor();
-}
-void lcd_cursor_off(void)
-{
-   lcd_cursor_enabled = 0;
-   lcd_toggle_cursor();
-}
-
-char lcd_is_cursor_enabled(void)
-{
-   return lcd_cursor_enabled;
-}
-
 static void update_panel_size(struct fdt_disp_config *config)
 {
panel_info.vl_col = config-width;
-- 
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/10] lcd, amba: remove this driver since it is not used

2013-01-22 Thread Jeroen Hofstee
Since CONFIG_VIDEO_AMBA is not set by any board, it does not seem
to be used, so remove it since there is no way to (compile) test it.

cc: Alessandro Rubini rub...@unipv.it
cc: Anatolij Gustschin ag...@denx.de
Acked-by: Alessandro Rubini rub...@unipv.it
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 drivers/video/Makefile |1 -
 drivers/video/amba.c   |   77 
 2 files changed, 78 deletions(-)
 delete mode 100644 drivers/video/amba.c

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 170a358..8ff3958 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -39,7 +39,6 @@ COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
 COBJS-$(CONFIG_LD9040) += ld9040.o
 COBJS-$(CONFIG_SED156X) += sed156x.o
-COBJS-$(CONFIG_VIDEO_AMBA) += amba.o
 COBJS-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
 COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 COBJS-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
diff --git a/drivers/video/amba.c b/drivers/video/amba.c
deleted file mode 100644
index b4fb47d..000
--- a/drivers/video/amba.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Driver for AMBA PrimeCell CLCD
- *
- * Copyright (C) 2009 Alessandro Rubini
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include common.h
-#include asm/io.h
-#include lcd.h
-#include amba_clcd.h
-
-/* These variables are required by lcd.c -- although it sets them by itself */
-int lcd_line_length;
-void *lcd_base;
-void *lcd_console_address;
-short console_col;
-short console_row;
-
-/*
- * To use this driver you need to provide the following in board files:
- * a panel_info definition
- * an lcd_enable function (can't define a weak default with current code)
- */
-
-/* There is nothing to do with color registers, we use true color */
-void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
-{
-   return;
-}
-
-/* Low level initialization of the logic cell: depends on panel_info */
-void lcd_ctrl_init(void *lcdbase)
-{
-   struct clcd_config *config;
-   struct clcd_registers *regs;
-   u32 cntl;
-
-   config = panel_info.priv;
-   regs = config-address;
-   cntl = config-cntl  ~CNTL_LCDEN;
-
-   /* Lazily, just copy the registers over: first control with disable */
-   writel(cntl, regs-cntl);
-
-   writel(config-tim0, regs-tim0);
-   writel(config-tim1, regs-tim1);
-   writel(config-tim2, regs-tim2);
-   writel(config-tim3, regs-tim3);
-   writel((u32)lcdbase, regs-ubas);
-   /* finally, enable */
-   writel(cntl | CNTL_LCDEN, regs-cntl);
-}
-
-/* This is trivial, and copied from atmel_lcdfb.c */
-ulong calc_fbsize(void)
-{
-   return ((panel_info.vl_col * panel_info.vl_row *
-   NBITS(panel_info.vl_bpix)) / 8) + PAGE_SIZE;
-}
-- 
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/10] lcd, mpc8xx: move the mpc8xx driver to drivers/video

2013-01-22 Thread Jeroen Hofstee
Since the lcd code was compiled unconditionally in arch also
add CONFIG_MPC8XX_LCD to the boards using this driver.

cc: Anatolij Gustschin ag...@denx.de
cc: Wolfgang Denk w...@denx.de
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 arch/powerpc/cpu/mpc8xx/Makefile   |1 -
 drivers/video/Makefile |1 +
 .../cpu/mpc8xx/lcd.c = drivers/video/mpc8xx_lcd.c |0
 include/configs/R360MPI.h  |1 +
 include/configs/RBC823.h   |1 +
 include/configs/RPXlite_DW.h   |1 +
 include/configs/RRvision.h |4 +++-
 include/configs/TQM823L.h  |1 +
 include/configs/TQM823M.h  |1 +
 include/configs/lwmon.h|1 +
 include/configs/svm_sc8xx.h|1 +
 include/configs/v37.h  |1 +
 12 files changed, 12 insertions(+), 2 deletions(-)
 rename arch/powerpc/cpu/mpc8xx/lcd.c = drivers/video/mpc8xx_lcd.c (100%)

diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile
index 0d1a12c..ef10e2d 100644
--- a/arch/powerpc/cpu/mpc8xx/Makefile
+++ b/arch/powerpc/cpu/mpc8xx/Makefile
@@ -37,7 +37,6 @@ COBJS-y   += fec.o
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
 COBJS-y+= i2c.o
 COBJS-y+= interrupts.o
-COBJS-y+= lcd.o
 COBJS-y+= scc.o
 COBJS-y+= serial.o
 COBJS-y+= speed.o
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 8ff3958..20b2e6f 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_EXYNOS_MIPI_DSIM) += exynos_mipi_dsi.o 
exynos_mipi_dsi_common.o \
exynos_mipi_dsi_lowlevel.o
 COBJS-$(CONFIG_EXYNOS_PWM_BL) += exynos_pwm_bl.o
 COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
+COBJS-$(CONFIG_MPC8XX_LCD) += mpc8xx_lcd.o
 COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
 COBJS-$(CONFIG_LD9040) += ld9040.o
diff --git a/arch/powerpc/cpu/mpc8xx/lcd.c b/drivers/video/mpc8xx_lcd.c
similarity index 100%
rename from arch/powerpc/cpu/mpc8xx/lcd.c
rename to drivers/video/mpc8xx_lcd.c
diff --git a/include/configs/R360MPI.h b/include/configs/R360MPI.h
index 868a0b8..60cccff 100644
--- a/include/configs/R360MPI.h
+++ b/include/configs/R360MPI.h
@@ -39,6 +39,7 @@
 #defineCONFIG_SYS_TEXT_BASE0x4000
 
 #define CONFIG_LCD
+#define CONFIG_MPC8XX_LCD
 #undef  CONFIG_EDT32F10
 #define CONFIG_SHARP_LQ057Q3DC02
 
diff --git a/include/configs/RBC823.h b/include/configs/RBC823.h
index b042c67..d4bcc62 100644
--- a/include/configs/RBC823.h
+++ b/include/configs/RBC823.h
@@ -47,6 +47,7 @@
 #endif
 #define CONFIG_KEYBOARD1   /* This board has a custom 
keybpard */
 #define CONFIG_LCD 1   /* use LCD controller ...   */
+#define CONFIG_MPC8XX_LCD
 #define CONFIG_HITACHI_SP19X001_Z1A/* The LCD type we use */
 
 #defineCONFIG_8xx_CONS_SMC21   /* Console is on SMC2   
*/
diff --git a/include/configs/RPXlite_DW.h b/include/configs/RPXlite_DW.h
index 67ab1e9..d8e28d5 100644
--- a/include/configs/RPXlite_DW.h
+++ b/include/configs/RPXlite_DW.h
@@ -54,6 +54,7 @@
 #defineCONFIG_SYS_TEXT_BASE0xff00
 
 #ifdef CONFIG_LCD  /* with LCD controller ?*/
+#define CONFIG_MPC8XX_LCD
 #define CONFIG_SPLASH_SCREEN   /* ... with splashscreen support*/
 #endif
 
diff --git a/include/configs/RRvision.h b/include/configs/RRvision.h
index e2b22f0..e2ea016 100644
--- a/include/configs/RRvision.h
+++ b/include/configs/RRvision.h
@@ -110,7 +110,9 @@
 #defineCONFIG_RTC_MPC8xx   /* use internal RTC of MPC8xx   
*/
 
 
-#ifndef CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_MPC8XX_LCD
+#else
 #define CONFIG_VIDEO   1   /* To enable the video initialization */
 
 /* Video related */
diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h
index 9fac5d1..cccf3af 100644
--- a/include/configs/TQM823L.h
+++ b/include/configs/TQM823L.h
@@ -39,6 +39,7 @@
 #defineCONFIG_SYS_TEXT_BASE0x4000
 
 #ifdef CONFIG_LCD  /* with LCD controller ?*/
+#define CONFIG_MPC8XX_LCD
 #define CONFIG_LCD_LOGO1   /* print our logo on the LCD
*/
 #define CONFIG_LCD_INFO1   /* ... and some board info  
*/
 #defineCONFIG_SPLASH_SCREEN/* ... with splashscreen 
support*/
diff --git a/include/configs/TQM823M.h b/include/configs/TQM823M.h
index 932f158..b2d1af0 100644
--- a/include/configs/TQM823M.h
+++ b/include/configs/TQM823M.h
@@ -39,6 +39,7 @@
 #defineCONFIG_SYS_TEXT_BASE0x4000
 
 #ifdef CONFIG_LCD  /* with LCD controller ?*/
+#define CONFIG_MPC8XX_LCD
 /* #define CONFIG_NEC_NL6448BC20 1 / * use NEC NL6448BC20 

[U-Boot] [PATCH v2 05/10] common/lcd.c: cleanup use of global variables

2013-01-22 Thread Jeroen Hofstee
console_col, console_row, lcd_line_length, lcd_console_address had
to be declared in board / driver specific code, but were not actually
used there. Get rid of the global variables.

for completeness, the ack of Bo Shen is for the atmel part
Cc: Alessandro Rubini rub...@unipv.it
Cc: Anatolij Gustschin ag...@denx.de
Cc: Bo Shen voice.s...@atmel.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut marek.va...@gmail.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Nikita Kiryanov nik...@compulab.co.il
Cc: Simon Glass s...@chromium.org
Cc: Stelian Pop stel...@popies.net
Cc: Tom Warren twar...@nvidia.com
Acked-by: Bo Shen voice.s...@atmel.com
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 board/mcc200/lcd.c   |6 --
 common/lcd.c |6 ++
 drivers/video/atmel_hlcdfb.c |6 --
 drivers/video/atmel_lcdfb.c  |6 --
 drivers/video/exynos_fb.c|6 --
 drivers/video/mpc8xx_lcd.c   |6 --
 drivers/video/pxa_lcd.c  |6 --
 drivers/video/tegra.c|6 --
 include/lcd.h|5 -
 9 files changed, 6 insertions(+), 47 deletions(-)

diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
index 0f3f585..caf8d8b 100644
--- a/board/mcc200/lcd.c
+++ b/board/mcc200/lcd.c
@@ -68,16 +68,10 @@ vidinfo_t panel_info = {
LCD_WIDTH, LCD_HEIGHT, LCD_BPP
 };
 
-int lcd_line_length;
-
 /*
  * Frame buffer memory information
  */
 void *lcd_base;/* Start of framebuffer memory  */
-void *lcd_console_address; /* Start of console buffer  */
-
-short console_col = 0;
-short console_row = 0;
 
 /*
  *  The device we use to communicate with PSoC
diff --git a/common/lcd.c b/common/lcd.c
index 2884f66..585ae8e 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -99,9 +99,15 @@ static void lcd_setbgcolor(int color);
 
 static int lcd_color_fg;
 static int lcd_color_bg;
+static int lcd_line_length;
 
 char lcd_is_enabled = 0;
 
+static short console_col;
+static short console_row;
+
+static void *lcd_console_address;
+
 static char lcd_flush_dcache;  /* 1 to flush dcache after each lcd update */
 
 
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index e74eb65..32626cf 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -29,13 +29,7 @@
 #include lcd.h
 #include atmel_hlcdc.h
 
-int lcd_line_length;
-
 void *lcd_base;/* Start of framebuffer memory  
*/
-void *lcd_console_address; /* Start of console buffer  */
-
-short console_col;
-short console_row;
 
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT0xc8
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index d96f175..370d9ca 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -29,13 +29,7 @@
 #include lcd.h
 #include atmel_lcdc.h
 
-int lcd_line_length;
-
 void *lcd_base;/* Start of framebuffer memory  
*/
-void *lcd_console_address; /* Start of console buffer  */
-
-short console_col;
-short console_row;
 
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT0xc8
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 4536c5c..82b19e5 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -33,13 +33,7 @@
 
 #include exynos_fb.h
 
-int lcd_line_length;
-
 void *lcd_base;
-void *lcd_console_address;
-
-short console_col;
-short console_row;
 
 static unsigned int panel_width, panel_height;
 
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 4fd44ac..26ad432 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -256,16 +256,10 @@ vidinfo_t panel_info = {
 /*--*/
 
 
-int lcd_line_length;
-
 /*
  * Frame buffer memory information
  */
 void *lcd_base;/* Start of framebuffer memory  */
-void *lcd_console_address; /* Start of console buffer  */
-
-short console_col;
-short console_row;
 
 //
 
diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
index 25747b1..57243ce 100644
--- a/drivers/video/pxa_lcd.c
+++ b/drivers/video/pxa_lcd.c
@@ -332,13 +332,7 @@ void lcd_getcolreg (ushort regno, ushort *red, ushort 
*green, ushort *blue);
 void lcd_ctrl_init (void *lcdbase);
 void lcd_enable(void);
 
-int lcd_line_length;
-
 void *lcd_base;/* Start of framebuffer memory  */
-void *lcd_console_address; /* Start of console buffer  */
-
-short console_col;
-short console_row;
 
 static int pxafb_init_mem (void *lcdbase, vidinfo_t *vid);
 static void pxafb_setup_gpio (vidinfo_t *vid);
diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index 26a96a5..0d1cfa9 100644
--- a/drivers/video/tegra.c

[U-Boot] [PATCH v2 06/10] common/lcd.c: remove global lcd_base

2013-01-22 Thread Jeroen Hofstee
lcd_base is available as gd-fb_base as well, there is no need
to keep a seperate copy.

For completeness the ack of Bo Shen is for the atmel part.
Cc: Alessandro Rubini rub...@unipv.it
Cc: Anatolij Gustschin ag...@denx.de
Cc: Bo Shen voice.s...@atmel.com
Cc: Haavard Skinnemoen haavard.skinnem...@atmel.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut marek.va...@gmail.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Nikita Kiryanov nik...@compulab.co.il
Cc: Simon Glass s...@chromium.org
Cc: Stelian Pop stel...@popies.net
Cc: Tom Warren twar...@nvidia.com
Acked-by: Bo Shen voice.s...@atmel.com
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 board/mcc200/lcd.c   |8 ++--
 common/lcd.c |1 +
 drivers/video/atmel_hlcdfb.c |2 --
 drivers/video/atmel_lcdfb.c  |2 --
 drivers/video/exynos_fb.c|8 +++-
 drivers/video/mpc8xx_lcd.c   |   12 ++--
 drivers/video/pxa_lcd.c  |2 --
 drivers/video/tegra.c|6 +-
 include/lcd.h|5 -
 9 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
index caf8d8b..1901908 100644
--- a/board/mcc200/lcd.c
+++ b/board/mcc200/lcd.c
@@ -68,10 +68,6 @@ vidinfo_t panel_info = {
LCD_WIDTH, LCD_HEIGHT, LCD_BPP
 };
 
-/*
- * Frame buffer memory information
- */
-void *lcd_base;/* Start of framebuffer memory  */
 
 /*
  *  The device we use to communicate with PSoC
@@ -147,12 +143,12 @@ void lcd_enable (void)
 
 #if !defined(SWAPPED_LCD)
for (i=0; ifb_size; i++) {
-   serial_putc_raw_dev (PSOC_PSC, ((char *)lcd_base)[i]);
+   serial_putc_raw_dev(PSOC_PSC, ((char *)gd-fb_base)[i]);
}
 #else
 {
int x, y, pwidth;
-   char *p = (char *)lcd_base;
+   char *p = (char *)gd-fb_base;
 
pwidth = ((panel_info.vl_col+7)  3);
for (y=0; ypanel_info.vl_row; y++) {
diff --git a/common/lcd.c b/common/lcd.c
index 585ae8e..59ca3b5 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -107,6 +107,7 @@ static short console_col;
 static short console_row;
 
 static void *lcd_console_address;
+static void *lcd_base; /* Start of framebuffer memory  */
 
 static char lcd_flush_dcache;  /* 1 to flush dcache after each lcd update */
 
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index 32626cf..fc95897 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -29,8 +29,6 @@
 #include lcd.h
 #include atmel_hlcdc.h
 
-void *lcd_base;/* Start of framebuffer memory  
*/
-
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT0xc8
 #define ATMEL_LCDC_DMA_BURST_LEN   8
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 370d9ca..2afeab2 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -29,8 +29,6 @@
 #include lcd.h
 #include atmel_lcdc.h
 
-void *lcd_base;/* Start of framebuffer memory  
*/
-
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT0xc8
 #define ATMEL_LCDC_DMA_BURST_LEN   8
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 82b19e5..c0f1830 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -33,7 +33,7 @@
 
 #include exynos_fb.h
 
-void *lcd_base;
+DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned int panel_width, panel_height;
 
@@ -44,11 +44,9 @@ static void exynos_lcd_init_mem(void *lcdbase, vidinfo_t 
*vid)
 
fb_size = vid-vl_row * vid-vl_col * (NBITS(vid-vl_bpix)  3);
 
-   lcd_base = lcdbase;
-
palette_size = NBITS(vid-vl_bpix) == 8 ? 256 : 16;
 
-   exynos_fimd_lcd_init_mem((unsigned long)lcd_base,
+   exynos_fimd_lcd_init_mem((unsigned long)lcdbase,
(unsigned long)fb_size, palette_size);
 }
 
@@ -140,7 +138,7 @@ void lcd_ctrl_init(void *lcdbase)
 void lcd_enable(void)
 {
if (panel_info.logo_on) {
-   memset(lcd_base, 0, panel_width * panel_height *
+   memset((void *) gd-fb_base, 0, panel_width * panel_height *
(NBITS(panel_info.vl_bpix)  3));
 #ifdef CONFIG_CMD_BMP
draw_logo();
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 26ad432..1aa1967 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -255,14 +255,6 @@ vidinfo_t panel_info = {
 #endif
 /*--*/
 
-
-/*
- * Frame buffer memory information
- */
-void *lcd_base;/* Start of framebuffer memory  */
-
-//
-
 void lcd_ctrl_init (void *lcdbase);
 void lcd_enable (void);
 #if LCD_BPP == LCD_COLOR8
@@ -392,8 +384,8 @@ void lcd_ctrl_init (void *lcdbase)
 * BIG NOTE:  

[U-Boot] [PATCH v2 08/10] lcd, fb: remove duplicated prototypes and unused code

2013-01-22 Thread Jeroen Hofstee
cc: Anatolij Gustschin ag...@denx.de
cc: Cliff Brake cliff.br...@gmail.com
cc: John Zhan zh...@sinovee.com
cc: Marek Vasut marek.va...@gmail.com
cc: Wolfgang Denk w...@denx.de
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 board/mcc200/lcd.c |7 ---
 drivers/video/mpc8xx_lcd.c |   40 
 drivers/video/pxa_lcd.c|   33 -
 3 files changed, 80 deletions(-)

diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
index 1901908..24f0abd 100644
--- a/board/mcc200/lcd.c
+++ b/board/mcc200/lcd.c
@@ -75,13 +75,6 @@ vidinfo_t panel_info = {
 int serial_inited = 0;
 
 /*
- * Exported functions
- */
-void lcd_initcolregs (void);
-void lcd_ctrl_init (void *lcdbase);
-void lcd_enable (void);
-
-/*
  *  Imported functions to support the PSoC protocol
  */
 extern int serial_init_dev (unsigned long dev_base);
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 1aa1967..f0f728e 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -253,23 +253,6 @@ vidinfo_t panel_info = {
 LCD_BPP,  0, 0, 0, 0, 33, 0, 0, 0
 };
 #endif
-/*--*/
-
-void lcd_ctrl_init (void *lcdbase);
-void lcd_enable (void);
-#if LCD_BPP == LCD_COLOR8
-void lcd_setcolreg (ushort regno,
-   ushort red, ushort green, ushort blue);
-#endif
-#if LCD_BPP == LCD_MONOCHROME
-void lcd_initcolregs (void);
-#endif
-
-#if defined(CONFIG_RBC823)
-void lcd_disable (void);
-#endif
-
-//
 
 //
 /* - chipset specific functions --- */
@@ -415,29 +398,6 @@ void lcd_ctrl_init (void *lcdbase)
 
 /*--*/
 
-#ifdef NOT_USED_SO_FAR
-static void
-lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue)
-{
-   volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-   volatile cpm8xx_t *cp = (immr-im_cpm);
-   unsigned short colreg, *cmap_ptr;
-
-   cmap_ptr = (unsigned short *)cp-lcd_cmap[regno * 2];
-
-   colreg = *cmap_ptr;
-#ifdef CONFIG_SYS_INVERT_COLORS
-   colreg ^= 0x0FFF;
-#endif
-
-   *red   = (colreg  8)  0x0F;
-   *green = (colreg  4)  0x0F;
-   *blue  =  colreg0x0F;
-}
-#endif /* NOT_USED_SO_FAR */
-
-/*--*/
-
 #if LCD_BPP == LCD_COLOR8
 void
 lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
index fef49c1..b40ec36 100644
--- a/drivers/video/pxa_lcd.c
+++ b/drivers/video/pxa_lcd.c
@@ -317,26 +317,10 @@ vidinfo_t panel_info = {
 
 /*--*/
 
-#if LCD_BPP == LCD_COLOR8
-void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue);
-#endif
-#if LCD_BPP == LCD_MONOCHROME
-void lcd_initcolregs (void);
-#endif
-
-#ifdef NOT_USED_SO_FAR
-void lcd_disable (void);
-void lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue);
-#endif /* NOT_USED_SO_FAR */
-
-void lcd_ctrl_init (void *lcdbase);
-void lcd_enable(void);
-
 static int pxafb_init_mem (void *lcdbase, vidinfo_t *vid);
 static void pxafb_setup_gpio (vidinfo_t *vid);
 static void pxafb_enable_controller (vidinfo_t *vid);
 static int pxafb_init (vidinfo_t *vid);
-//
 
 //
 /* ---  PXA chipset specific functions  --- */
@@ -351,14 +335,6 @@ void lcd_ctrl_init (void *lcdbase)
 }
 
 /*--*/
-#ifdef NOT_USED_SO_FAR
-void
-lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue)
-{
-}
-#endif /* NOT_USED_SO_FAR */
-
-/*--*/
 #if LCD_BPP == LCD_COLOR8
 void
 lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
@@ -406,15 +382,6 @@ void lcd_enable (void)
 {
 }
 
-/*--*/
-#ifdef NOT_USED_SO_FAR
-static void lcd_disable (void)
-{
-}
-#endif /* NOT_USED_SO_FAR */
-
-/*--*/
-
 //
 /* ** PXA255 specific routines */
 //
-- 
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 09/10] api/api_display: use the getters for console size info

2013-01-22 Thread Jeroen Hofstee
cc: Che-Liang Chiou clch...@chromium.org
Acked-by: Che-Liang Chiou clch...@chromium.org
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 api/api_display.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/api/api_display.c b/api/api_display.c
index 6439170..c167db7 100644
--- a/api/api_display.c
+++ b/api/api_display.c
@@ -45,8 +45,8 @@ int display_get_info(int type, struct display_info *di)
case DISPLAY_TYPE_LCD:
di-pixel_width  = panel_info.vl_col;
di-pixel_height = panel_info.vl_row;
-   di-screen_rows = CONSOLE_ROWS;
-   di-screen_cols = CONSOLE_COLS;
+   di-screen_rows = lcd_get_screen_rows();
+   di-screen_cols = lcd_get_screen_columns();
break;
 #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 04/10] lcd, pxafb: move the pxafb to drivers/video

2013-01-22 Thread Jeroen Hofstee
Since the lcd code was compiled unconditionally for pxa also add
CONFIG_PXA_LCD to the boards using this framebuffer. Since
driver/video contains video and lcd drivers, add lcd to the name
to make clear it belongs to common/lcd.c.

cc: Anatolij Gustschin ag...@denx.de
cc: Cliff Brake cliff.br...@gmail.com
cc: Marek Vasut marek.va...@gmail.com
Acked-by: Marek Vasut ma...@denx.de
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 arch/arm/cpu/pxa/Makefile  |1 -
 drivers/video/Makefile |1 +
 .../arm/cpu/pxa/pxafb.c = drivers/video/pxa_lcd.c |0
 include/configs/lubbock.h  |1 +
 include/configs/palmld.h   |1 +
 include/configs/palmtc.h   |1 +
 include/configs/pxa255_idp.h   |1 +
 include/configs/zipitz2.h  |1 +
 8 files changed, 6 insertions(+), 1 deletion(-)
 rename arch/arm/cpu/pxa/pxafb.c = drivers/video/pxa_lcd.c (100%)

diff --git a/arch/arm/cpu/pxa/Makefile b/arch/arm/cpu/pxa/Makefile
index e088832..9f63c34 100644
--- a/arch/arm/cpu/pxa/Makefile
+++ b/arch/arm/cpu/pxa/Makefile
@@ -33,7 +33,6 @@ COBJS-$(CONFIG_CPU_PXA27X)= pxa2xx.o
 COBJS-y+= cpuinfo.o
 
 COBJS  = $(COBJS-y)
-COBJS  += pxafb.o
 COBJS  += timer.o
 COBJS  += usb.o
 
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 20b2e6f..250aebd 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_EXYNOS_MIPI_DSIM) += exynos_mipi_dsi.o 
exynos_mipi_dsi_common.o \
 COBJS-$(CONFIG_EXYNOS_PWM_BL) += exynos_pwm_bl.o
 COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
 COBJS-$(CONFIG_MPC8XX_LCD) += mpc8xx_lcd.o
+COBJS-$(CONFIG_PXA_LCD) += pxa_lcd.o
 COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
 COBJS-$(CONFIG_LD9040) += ld9040.o
diff --git a/arch/arm/cpu/pxa/pxafb.c b/drivers/video/pxa_lcd.c
similarity index 100%
rename from arch/arm/cpu/pxa/pxafb.c
rename to drivers/video/pxa_lcd.c
diff --git a/include/configs/lubbock.h b/include/configs/lubbock.h
index 5886a15..b99a056 100644
--- a/include/configs/lubbock.h
+++ b/include/configs/lubbock.h
@@ -38,6 +38,7 @@
 #define CONFIG_LUBBOCK 1   /* on an LUBBOCK Board  */
 #define CONFIG_LCD 1
 #ifdef CONFIG_LCD
+#define CONFIG_PXA_LCD
 #define CONFIG_SHARP_LM8V31
 #endif
 #define CONFIG_MMC
diff --git a/include/configs/palmld.h b/include/configs/palmld.h
index 3f9802c..4ee2e46 100644
--- a/include/configs/palmld.h
+++ b/include/configs/palmld.h
@@ -72,6 +72,7 @@
 #defineCONFIG_CMD_MMC
 #defineCONFIG_CMD_IDE
 #defineCONFIG_LCD
+#defineCONFIG_PXA_LCD
 
 /*
  * MMC Card Configuration
diff --git a/include/configs/palmtc.h b/include/configs/palmtc.h
index 64771e7..70fe05c 100644
--- a/include/configs/palmtc.h
+++ b/include/configs/palmtc.h
@@ -74,6 +74,7 @@
 #defineCONFIG_CMD_ENV
 #defineCONFIG_CMD_MMC
 #defineCONFIG_LCD
+#defineCONFIG_PXA_LCD
 
 /*
  * MMC Card Configuration
diff --git a/include/configs/pxa255_idp.h b/include/configs/pxa255_idp.h
index 5a15af6..39c167f 100644
--- a/include/configs/pxa255_idp.h
+++ b/include/configs/pxa255_idp.h
@@ -59,6 +59,7 @@
 
 #undef CONFIG_LCD
 #ifdef CONFIG_LCD
+#define CONFIG_PXA_LCD
 #define CONFIG_SHARP_LM8V31
 #endif
 
diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
index b92f70b..f79dd3b 100644
--- a/include/configs/zipitz2.h
+++ b/include/configs/zipitz2.h
@@ -103,6 +103,7 @@
 #ifdef CONFIG_CMD_SPI
 #defineCONFIG_SOFT_SPI
 #defineCONFIG_LCD
+#defineCONFIG_PXA_LCD
 #defineCONFIG_LMS283GF05
 #defineCONFIG_VIDEO_LOGO
 #defineCONFIG_CMD_BMP
-- 
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 4/7 v5] EXYNOS5: TMU: Add TMU init and status check

2013-01-22 Thread Simon Glass
On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 This adds call to tmu_init() and TMU boot time analysis
 for the SoC temperature threshold breach.

 Signed-off-by: Akshay Saraswat aksha...@samsung.com

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes since v4:
 - Replaced board polling with initial SoC temperature analysis for 
 any possible threshold breach.

  board/samsung/smdk5250/smdk5250.c |   35 +++
  1 file changed, 35 insertions(+)

 diff --git a/board/samsung/smdk5250/smdk5250.c 
 b/board/samsung/smdk5250/smdk5250.c
 index 7a5f132..7b9a8c5 100644
 --- a/board/samsung/smdk5250/smdk5250.c
 +++ b/board/samsung/smdk5250/smdk5250.c
 @@ -35,9 +35,35 @@
  #include asm/arch/sromc.h
  #include asm/arch/dp_info.h
  #include power/pmic.h
 +#include tmu.h

  DECLARE_GLOBAL_DATA_PTR;

 +#if defined CONFIG_EXYNOS_TMU
 +/*
 + * Boot Time Thermal Analysis for SoC temperature threshold breach
 + */
 +void boot_temp_check(void)
 +{
 +   int temp;
 +
 +   switch (tmu_monitor(temp)) {
 +   case TMU_STATUS_TRIPPED:
 +   puts(EXYNOS_TMU: TRIPPING! Device power going down ...\n);
 +   board_poweroff();
 +   break;
 +   case TMU_STATUS_WARNING:
 +   puts(EXYNOS_TMU: WARNING! Temperature very high\n);
 +   break;
 +   case TMU_STATUS_NORMAL:
 +   break;
 +   case TMU_STATUS_INIT:
 +   default:
 +   debug(Unknown TMU state\n);
 +   }
 +}
 +#endif
 +
  #ifdef CONFIG_USB_EHCI_EXYNOS
  int board_usb_vbus_init(void)
  {
 @@ -57,6 +83,15 @@ int board_usb_vbus_init(void)
  int board_init(void)
  {
 gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 +
 +#if defined CONFIG_EXYNOS_TMU
 +   if (tmu_init(gd-fdt_blob)) {
 +   debug(%s: Failed to init TMU\n, __func__);
 +   return -1;
 +   }
 +   boot_temp_check();
 +#endif
 +
  #ifdef CONFIG_EXYNOS_SPI
 spi_init();
  #endif
 --
 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 v2 2/7] Tegra114: Add AVP (arm720t) files

2013-01-22 Thread Tom Warren
Stephen,

On Fri, Jan 18, 2013 at 5:09 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/18/2013 05:01 PM, Stephen Warren wrote:
 On 01/18/2013 02:12 PM, Tom Warren wrote:
 This provides SPL support for T114 boards - AVP early init, plus
 CPU (A15) init/jump to main U-Boot.

 +void powerup_cpus(void)
 +{
 +debug(powerup_cpus entry\n);
 +
 +/* Are we booting to the fast cluster? */
 +if (get_cluster_id() == 0) {
 +debug(powerup_cpus entry: G cluster\n);
 +/* Power up the fast cluster rail partition */
 +power_partition(CRAIL, CRAILID);
 +
 +/* Power up the fast cluster non-CPU partition */
 +power_partition(C0NC, C0NCID);
 +
 +/* Power up the fast cluster CPU0 partition */
 +power_partition(CE0, CE0ID);
 +} else {
 +debug(powerup_cpus entry: LP cluster\n);
 +/* Power up the slow cluster non-CPU partition */
 +power_partition(C1NC, C1NCID);
 +
 +/* Power up the slow cluster CPU partition */
 +power_partition(CELP, CELPID);
 +}
 +}

 I strongly believe we should determine why that is needed rather than
 blindly upstreaming it.

 Thinking about this more, this makes even less sense. When Tegra boots,
 code runs on the AVP. That code is U-Boot. U-Boot then boots the A15
 cores, and hence U-Boot is what decides whether to boot the LP or G
 cluster; it doesn't follow some decision by some other SW since there is
 no other SW.

 The only possible exception to this might be resume from some low-power
 state where you want to restart the same A15 cluster as was running
 prior to entering sleep. But that would require the flow controller
 register read by get_cluster_id() to be in an always-on power domain.
 I'm not sure if that's true or not. (If it isnt', presumably the
 power-on state would always be static, hence there would be no need to
 read the register).

I agree with your analysis. How about if I remove get_cluster_id(),
and just set the power partitions for the fast cluster?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/7 v5] EXYNOS5: Config: Enable support for Exynos TMU driver

2013-01-22 Thread Simon Glass
On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 Enables TMU driver support for exynos5250

 Signed-off-by: Akshay Saraswat aksha...@samsung.com

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes since v4:
 - Rebased this patch.

  include/configs/exynos5250-dt.h |3 +++
  1 file changed, 3 insertions(+)

 diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
 index cabd2f2..53ca41f 100644
 --- a/include/configs/exynos5250-dt.h
 +++ b/include/configs/exynos5250-dt.h
 @@ -117,6 +117,9 @@
  #define CONFIG_BOOTDELAY   3
  #define CONFIG_ZERO_BOOTDELAY_CHECK

 +/* Thermal Management Unit */
 +#define CONFIG_EXYNOS_TMU
 +
  /* USB */
  #define CONFIG_CMD_USB
  #define CONFIG_USB_EHCI
 --
 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 7/7] Tegra114: Add/enable Dalmore build (T114 reference board)

2013-01-22 Thread Tom Warren
Simon,

On Mon, Jan 21, 2013 at 4:07 PM, Simon Glass s...@chromium.org wrote:
 Hi Stephen,

 On Wed, Jan 16, 2013 at 2:51 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/16/2013 02:14 PM, Tom Warren wrote:
 This build is stripped down. It boots to the command prompt.
 GPIO is the only peripheral supported. Others TBD.

 diff --git a/board/nvidia/dalmore/dalmore.c b/board/nvidia/dalmore/dalmore.c

 +void pinmux_init(void)
 +{
 + pinmux_config_table(tegra3_pinmux_common,
 + ARRAY_SIZE(tegra3_pinmux_common));

 I assume that should say tegra114 not tegra3?

 diff --git a/include/configs/dalmore.h b/include/configs/dalmore.h

 +/* Must be off for Dalmore to boot !?!? FIXME */
 +#define CONFIG_SYS_DCACHE_OFF

 Who knows if there is any A15 core/cache controller support in U-Boot yet?

 Sort-of. It works ok for me on snow, so long as you have a patch to
 enable L2 support.

Which patch, exactly, to enable L2 support? I'd like to test it on T114.

Thanks

 Regards,
 Simon


 Aside from any comments I've made, the series, briefly,
 Reviewed-by: Stephen Warren swar...@nvidia.com
 ___
 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 6/7 v5] TMU: Add TMU support in dtt command

2013-01-22 Thread Simon Glass
Hi Akshay,

On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 Add generic TMU support alongwith i2c sensors in dtt command
 to enable temperature reading in cases where TMU is present
 instead of i2c sensors.

 Signed-off-by: Akshay Saraswat aksha...@samsung.com
 ---
 Changes since v4:
 - Removed tmu command and added to dtt.

  common/cmd_dtt.c |   19 +++
  1 file changed, 19 insertions(+)

 diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c
 index cd94423..715f4ba 100644
 --- a/common/cmd_dtt.c
 +++ b/common/cmd_dtt.c
 @@ -28,6 +28,20 @@
  #include dtt.h
  #include i2c.h

 +#if defined CONFIG_TMU_CMD_DTT
 +#include tmu.h
 +
 +void dtt_get_temp(void)
 +{
 +   int cur_temp;
 +
 +   if (tmu_monitor(cur_temp) == TMU_STATUS_INIT)
 +   printf(TMU is in unknown state, temperature is invalid \n);

puts()

Should return an error result here so that do_dtt() returns 1.

 +   else
 +   printf(Current temperature: %u degrees Celsius \n, 
 cur_temp);
 +}
 +
 +#else
  static unsigned long sensor_initialized;

  static void _initialize_dtt(void)
 @@ -59,9 +73,13 @@ void dtt_init(void)
 /* switch back to original I2C bus */
 I2C_SET_BUS(old_bus);
  }
 +#endif

  int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
  {
 +#if defined CONFIG_TMU_CMD_DTT
 +   dtt_get_temp();
 +#else

How about creating two versions of the dtt_get_temp() function: one
with your code and one with the old code? Then you don't have an
#ifdef here.



 int i;
 unsigned char sensors[] = CONFIG_DTT_SENSORS;
 int old_bus;
 @@ -83,6 +101,7 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * 
 const argv[])

 /* switch back to original I2C bus */
 I2C_SET_BUS(old_bus);
 +#endif

 return 0;
  }  /* do_dtt() */
 --
 1.7.9.5


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


Re: [U-Boot] [PATCH 7/7 v5] EXYNOS5: Config: Enable dtt command for TMU

2013-01-22 Thread Simon Glass
On Mon, Jan 21, 2013 at 3:11 AM, Akshay Saraswat aksha...@samsung.com wrote:
 This enables the dtt command to read the current SOC
 temperature with the help of TMU

 Signed-off-by: Akshay Saraswat aksha...@samsung.com

Acked-by: Simon Glass s...@chromium.org

 ---
 Changes since v4:
 - Replaced tmu command configs with corresponding dtt configs.

  include/configs/exynos5250-dt.h |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
 index 53ca41f..8a8e9fe 100644
 --- a/include/configs/exynos5250-dt.h
 +++ b/include/configs/exynos5250-dt.h
 @@ -119,6 +119,8 @@

  /* Thermal Management Unit */
  #define CONFIG_EXYNOS_TMU
 +#define CONFIG_CMD_DTT
 +#define CONFIG_TMU_CMD_DTT

  /* USB */
  #define CONFIG_CMD_USB
 --
 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 v2 4/7] Tegra114: Add common CPU (shared) files

2013-01-22 Thread Simon Glass
Hi Tom,

On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 These files are used by both SPL and main U-Boot.

 Signed-off-by: Tom Warren twar...@nvidia.com
 ---
 Changes in v2:
 - update all new copyright header dates to 2013
 - use ODMDATA correctly in query_dram_size

  arch/arm/cpu/tegra-common/ap.c |9 +-
  arch/arm/cpu/tegra-common/board.c  |   21 +-
  arch/arm/cpu/tegra114-common/Makefile  |   41 ++
  arch/arm/cpu/tegra114-common/clock.c   | 1150 
 
  arch/arm/cpu/tegra114-common/funcmux.c |   63 ++
  arch/arm/cpu/tegra114-common/pinmux.c  |  506 ++
  6 files changed, 1786 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/cpu/tegra114-common/Makefile
  create mode 100644 arch/arm/cpu/tegra114-common/clock.c
  create mode 100644 arch/arm/cpu/tegra114-common/funcmux.c
  create mode 100644 arch/arm/cpu/tegra114-common/pinmux.c


I'm a bit concerned about the code duplication here. Isn't much of
this code common?

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


Re: [U-Boot] [PATCH] MIPS: start{, 64}.S: fill branch delay slots with NOP instructions

2013-01-22 Thread Daniel Schwierzeck
2013/1/16 Gabor Juhos juh...@openwrt.org:
 The romReserved and romExcHandle handlers are
 accessed by a branch instruction however the
 delay slots of those instructions are not filled.

 Because the start.S uses the 'noreorder' directive,
 the assembler will not fill the delay slots either,
 and leads to the following assembly code:

   056c romReserved:
56c:   1000b   56c romReserved

   0570 romExcHandle:
570:   1000b   570 romExcHandle

 In the resulting code, the second branch instruction
 is placed into the delay slot of the first branch
 instruction, which is not allowed on the MIPS
 architecture.

 Signed-off-by: Gabor Juhos juh...@openwrt.org
 Cc: Daniel Schwierzeck daniel.schwierz...@googlemail.com
 ---
  arch/mips/cpu/mips32/start.S |2 ++
  arch/mips/cpu/mips64/start.S |1 +
  2 files changed, 3 insertions(+)

applied to u-boot-mips/master, thanks

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


Re: [U-Boot] [PATCH 7/7] Tegra114: Add/enable Dalmore build (T114 reference board)

2013-01-22 Thread Simon Glass
Hi Tom,

On Tue, Jan 22, 2013 at 12:47 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 Simon,

 On Mon, Jan 21, 2013 at 4:07 PM, Simon Glass s...@chromium.org wrote:
 Hi Stephen,

 On Wed, Jan 16, 2013 at 2:51 PM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 On 01/16/2013 02:14 PM, Tom Warren wrote:
 This build is stripped down. It boots to the command prompt.
 GPIO is the only peripheral supported. Others TBD.

 diff --git a/board/nvidia/dalmore/dalmore.c 
 b/board/nvidia/dalmore/dalmore.c

 +void pinmux_init(void)
 +{
 + pinmux_config_table(tegra3_pinmux_common,
 + ARRAY_SIZE(tegra3_pinmux_common));

 I assume that should say tegra114 not tegra3?

 diff --git a/include/configs/dalmore.h b/include/configs/dalmore.h

 +/* Must be off for Dalmore to boot !?!? FIXME */
 +#define CONFIG_SYS_DCACHE_OFF

 Who knows if there is any A15 core/cache controller support in U-Boot yet?

 Sort-of. It works ok for me on snow, so long as you have a patch to
 enable L2 support.

 Which patch, exactly, to enable L2 support? I'd like to test it on T114.

I was thinking about this one (it will need porting and perhaps can
become partly common?)

http://patchwork.ozlabs.org/patch/202874/

Regards,
Simon


 Thanks

 Regards,
 Simon


 Aside from any comments I've made, the series, briefly,
 Reviewed-by: Stephen Warren swar...@nvidia.com
 ___
 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 2/2] MIPS: convert IO port accessor functions to 'static inline'

2013-01-22 Thread Daniel Schwierzeck
2013/1/16 Gabor Juhos juh...@openwrt.org:
 The currently used 'extern inline' directive causes
 the following compiler warnings if CONFIG_SWAP_IO_SPACE
 is defined:

   .../include/asm/io.h:345:1: warning: '__fswab32' is static but used in 
 inline function '__outlc_p' which is not static [enabled by default]
   .../include/asm/io.h:345:1: warning: '__fswab32' is static but used in 
 inline function '__outl_p' which is not static [enabled by default]
   .../include/asm/io.h:345:1: warning: '__fswab32' is static but used in 
 inline function '__outlc' which is not static [enabled by default]
   .../include/asm/io.h:345:1: warning: '__fswab32' is static but used in 
 inline function '__outl' which is not static [enabled by default]
   .../include/asm/io.h:344:1: warning: '__fswab16' is static but used in 
 inline function '__outwc_p' which is not static [enabled by default]
   .../include/asm/io.h:344:1: warning: '__fswab16' is static but used in 
 inline function '__outw_p' which is not static [enabled by default]
   .../include/asm/io.h:344:1: warning: '__fswab16' is static but used in 
 inline function '__outwc' which is not static [enabled by default]
   .../include/asm/io.h:344:1: warning: '__fswab16' is static but used in 
 inline function '__outw' which is not static [enabled by default]
   .../include/asm/io.h:341:1: warning: '__fswab32' is static but used in 
 inline function '__inlc_p' which is not static [enabled by default]
   .../include/asm/io.h:341:1: warning: '__fswab32' is static but used in 
 inline function '__inl_p' which is not static [enabled by default]
   .../include/asm/io.h:341:1: warning: '__fswab32' is static but used in 
 inline function '__inlc' which is not static [enabled by default]
   .../include/asm/io.h:341:1: warning: '__fswab32' is static but used in 
 inline function '__inl' which is not static [enabled by default]
   .../include/asm/io.h:340:1: warning: '__fswab16' is static but used in 
 inline function '__inwc_p' which is not static [enabled by default]
   .../include/asm/io.h:340:1: warning: '__fswab16' is static but used in 
 inline function '__inw_p' which is not static [enabled by default]
   .../include/asm/io.h:340:1: warning: '__fswab16' is static but used in 
 inline function '__inwc' which is not static [enabled by default]
   .../include/asm/io.h:340:1: warning: '__fswab16' is static but used in 
 inline function '__inw' which is not static [enabled by default]

 Signed-off-by: Gabor Juhos juh...@openwrt.org
 Cc: Daniel Schwierzeck daniel.schwierz...@googlemail.com

 ---
 NOTE: checkpatch.pl throwns some errors/warnings for the patch:

   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:42: ERROR: 
 open brace '{' following function declarations go on the next line
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:51: ERROR: 
 open brace '{' following function declarations go on the next line
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: 
 WARNING: line over 80 characters
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: ERROR: 
 foo * bar should be foo *bar
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:60: ERROR: 
 open brace '{' following function declarations go on the next line
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: 
 WARNING: line over 80 characters
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: ERROR: 
 foo * bar should be foo *bar
   0002-MIPS-convert-IO-port-accessor-functions-to-static-in.patch:69: ERROR: 
 open brace '{' following function declarations go on the next line

 However those errors are already present if the
 'arch/mips/include/asm/io.h' file is checked
 with checkpatch.pl. The cleanup should be done
 in a separare patch.
 ---
  arch/mips/include/asm/io.h |8 
  1 file changed, 4 insertions(+), 4 deletions(-)

applied to u-boot-mips/master, thanks

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


Re: [U-Boot] [PATCH 1/2] MIPS: use inline directive for __in*s functions

2013-01-22 Thread Daniel Schwierzeck
2013/1/16 Gabor Juhos juh...@openwrt.org:
 All other IO accessor functions are using the
 'inline' directive. Use that also for the __in*s
 to make it consistent with the other variants.

 Signed-off-by: Gabor Juhos juh...@openwrt.org
 Cc: Daniel Schwierzeck daniel.schwierz...@googlemail.com

 ---
 NOTE: checkpatch.pl throwns an error for the patch:

   0001-MIPS-use-inline-directive-for-__in-s-functions.patch:24: ERROR: open 
 brace '{' following function declarations go on the next line
   total: 1 errors, 0 warnings, 8 lines checked

 However that error is already present if the
 'arch/mips/include/asm/io.h' file is checked
 with checkpatch.pl. The cleanup should be
 done in a separare patch.
 ---
  arch/mips/include/asm/io.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


applied to u-boot-mips/master, thanks

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


Re: [U-Boot] [PATCH v2 1/7] Tegra114: Add arch-tegra114 include files

2013-01-22 Thread Stephen Warren
On 01/22/2013 01:44 PM, Tom Warren wrote:
 Stephen,
 
 On Fri, Jan 18, 2013 at 4:54 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/18/2013 02:12 PM, Tom Warren wrote:
 Common Tegra files are in arch-tegra, shared between T20/T30/T114.
 Tegra114-specific headers are in arch-tegra114. Note that some of
 these will be filled in as more T114 support is added (drivers,
 WB/LP0 support, etc.).

 diff --git a/arch/arm/include/asm/arch-tegra/tegra.h 
 b/arch/arm/include/asm/arch-tegra/tegra.h
 index 013a3c5..2dbe6a3 100644
 --- a/arch/arm/include/asm/arch-tegra/tegra.h
 +++ b/arch/arm/include/asm/arch-tegra/tegra.h
 @@ -73,6 +73,7 @@ enum {
   SKU_ID_AP25E= 0x1b,
   SKU_ID_T25E = 0x1c,
   SKU_ID_T30  = 0x81, /* Cardhu value */
 + SKU_ID_T114 = 0x00, /* Dalmore value */

 I believe a SKU ID of 0 indicates an unfused or engineering part. I'll
 try to find the relevant email and forward it to you off-list. As such,
 I think it'll save us trouble in the future if you simply rename that
 SKU_ID_T114_UNFUSED/GENERIC/ENG/ENGINEERING to make it explicit what
 this means. You should probably talk to someone internally to confirm
 the best terminology to use here; probably whoever originally sent the
 email that I'll try to forward to you. I think you can make such a
 trivial symbol renaming change when you apply the patch, without
 reposting the patches, unless any other changes are needed.
 
 I can change this to SKU_ID_T114_ENG. Would that be sufficient?

That's probably reasonable, yes.

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


Re: [U-Boot] [PATCH v2 2/7] Tegra114: Add AVP (arm720t) files

2013-01-22 Thread Stephen Warren
On 01/22/2013 01:46 PM, Tom Warren wrote:
 Stephen,
 
 On Fri, Jan 18, 2013 at 5:09 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/18/2013 05:01 PM, Stephen Warren wrote:
 On 01/18/2013 02:12 PM, Tom Warren wrote:
 This provides SPL support for T114 boards - AVP early init, plus
 CPU (A15) init/jump to main U-Boot.

 +void powerup_cpus(void)
 +{
 +debug(powerup_cpus entry\n);
 +
 +/* Are we booting to the fast cluster? */
 +if (get_cluster_id() == 0) {
 +debug(powerup_cpus entry: G cluster\n);
 +/* Power up the fast cluster rail partition */
 +power_partition(CRAIL, CRAILID);
 +
 +/* Power up the fast cluster non-CPU partition */
 +power_partition(C0NC, C0NCID);
 +
 +/* Power up the fast cluster CPU0 partition */
 +power_partition(CE0, CE0ID);
 +} else {
 +debug(powerup_cpus entry: LP cluster\n);
 +/* Power up the slow cluster non-CPU partition */
 +power_partition(C1NC, C1NCID);
 +
 +/* Power up the slow cluster CPU partition */
 +power_partition(CELP, CELPID);
 +}
 +}

 I strongly believe we should determine why that is needed rather than
 blindly upstreaming it.

 Thinking about this more, this makes even less sense. When Tegra boots,
 code runs on the AVP. That code is U-Boot. U-Boot then boots the A15
 cores, and hence U-Boot is what decides whether to boot the LP or G
 cluster; it doesn't follow some decision by some other SW since there is
 no other SW.

 The only possible exception to this might be resume from some low-power
 state where you want to restart the same A15 cluster as was running
 prior to entering sleep. But that would require the flow controller
 register read by get_cluster_id() to be in an always-on power domain.
 I'm not sure if that's true or not. (If it isnt', presumably the
 power-on state would always be static, hence there would be no need to
 read the register).
 
 I agree with your analysis. How about if I remove get_cluster_id(),
 and just set the power partitions for the fast cluster?

I think that makes sense, yes.

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


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Simon Glass
Hi Stephen,

On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.

What is the intended use of this function? (sorry, yes, I am confused :-)


 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
 This patch will need updating due to the recently added Tegra30 support.
 However, I'm posting it for Lucas, since his NAND patches can probably
 benefit from this.

  arch/arm/cpu/tegra20-common/pinmux.c   |   23 +++
  arch/arm/include/asm/arch-tegra20/pinmux.h |6 ++
  2 files changed, 29 insertions(+)

 diff --git a/arch/arm/cpu/tegra20-common/pinmux.c 
 b/arch/arm/cpu/tegra20-common/pinmux.c
 index 5ad2121..47179f3 100644
 --- a/arch/arm/cpu/tegra20-common/pinmux.c
 +++ b/arch/arm/cpu/tegra20-common/pinmux.c
 @@ -554,6 +554,29 @@ void pinmux_set_func(enum pmux_pingrp pin, enum 
 pmux_func func)
 writel(reg, muxctl);
  }

 +static enum pmux_func pinmux_get_func(enum pmux_pingrp pin)
 +{
 +   struct pmux_tri_ctlr *pmt =
 +   (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
 +   enum pmux_ctlid mux_id = tegra_soc_pingroups[pin].ctl_id;
 +   u32 *muxctl = pmt-pmt_ctl[MUXCTL_REG(mux_id)];
 +   u32 reg;
 +
 +   reg = readl(muxctl);
 +   reg = MUXCTL_SHIFT(mux_id);
 +   reg = 3;
 +
 +   return tegra_soc_pingroups[pin].funcs[reg];
 +}
 +
 +void pinmux_avoid_func(enum pmux_pingrp pin, enum pmux_func avoid)
 +{
 +   if (pinmux_get_func(pin) != avoid)
 +   return;

Is this an error - does the caller need to know?

 +
 +   pinmux_set_func(pin, tegra_soc_pingroups[pin].func_safe);
 +}
 +
  void pinmux_config_pingroup(const struct pingroup_config *config)
  {
 enum pmux_pingrp pin = config-pingroup;
 diff --git a/arch/arm/include/asm/arch-tegra20/pinmux.h 
 b/arch/arm/include/asm/arch-tegra20/pinmux.h
 index a9b4eda..d36e18e 100644
 --- a/arch/arm/include/asm/arch-tegra20/pinmux.h
 +++ b/arch/arm/include/asm/arch-tegra20/pinmux.h
 @@ -337,6 +337,12 @@ void pinmux_set_pullupdown(enum pmux_pingrp pin, enum 
 pmux_pull pupd);
  /* Set the mux function for a pin group */
  void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func);

 +/*
 + * Select the safe (non-conflicting) mux function for a pin group if the
 + * current setting matches the specified function.
 + */

What does it do when it doesn't match, and perhaps comment when you
might find this function useful?

 +void pinmux_avoid_func(enum pmux_pingrp pin, enum pmux_func func);
 +
  /* Set the complete configuration for a pin group */
  void pinmux_config_pingroup(const struct pingroup_config *config);

 --
 1.7.10.4


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


Re: [U-Boot] [PATCH 1/2] tegra: don't hard-code LCD into default TEGRA_DEVICE_SETTINGS

2013-01-22 Thread Simon Glass
On Tue, Jan 22, 2013 at 8:20 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 Only add lcd into TEGRA_DEVICE_SETTINGS if CONFIG_VIDEO_TEGRA.
 Otherwise, lcd is meaningless.

 Signed-off-by: Stephen Warren swar...@nvidia.com

Acked-by: Simon Glass s...@chromium.org

 ---
  include/configs/tegra-common-post.h |   11 +--
  1 file changed, 9 insertions(+), 2 deletions(-)

 diff --git a/include/configs/tegra-common-post.h 
 b/include/configs/tegra-common-post.h
 index 74bebb7..f2a70b1 100644
 --- a/include/configs/tegra-common-post.h
 +++ b/include/configs/tegra-common-post.h
 @@ -133,10 +133,17 @@
  #define STDIN_KBD_USB 
  #endif

 +#ifdef CONFIG_VIDEO_TEGRA
 +#define STDOUT_LCD ,lcd
 +#else
 +#define STDOUT_LCD 
 +#endif
 +
  #define TEGRA_DEVICE_SETTINGS \
 stdin=serial STDIN_KBD_KBC STDIN_KBD_USB \0 \
 -   stdout=serial,lcd\0 \
 -   stderr=serial,lcd\0 \
 +   stdout=serial STDOUT_LCD \0 \
 +   stderr=serial STDOUT_LCD \0 \
 +   

  #define CONFIG_EXTRA_ENV_SETTINGS \
 TEGRA_DEVICE_SETTINGS \
 --
 1.7.10.4

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


Re: [U-Boot] [PATCH 2/2] tegra: rename FUNCMUX_UART2_UARTB

2013-01-22 Thread Simon Glass
On Tue, Jan 22, 2013 at 8:20 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 FUNCMUX_ defines should be named after the pin groups they affect, not
 after the module they're muxing onto those pin groups.

 Signed-off-by: Stephen Warren swar...@nvidia.com

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Stephen Warren
On 01/22/2013 02:13 PM, Simon Glass wrote:
 Hi Stephen,
 
 On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.
 
 What is the intended use of this function? (sorry, yes, I am confused :-)

It's a safer way of doing this:
tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT
http://lists.denx.de/pipermail/u-boot/2013-January/144612.html

i.e. it address the concerns I raised here:
http://lists.denx.de/pipermail/u-boot/2013-January/144713.html

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


[U-Boot] [PATCH] Fix MCF5235 SDRAM base address macro

2013-01-22 Thread Steve deRosier
SDRAMC_DARCn_BA() macro worked fine when the BA is 0x even
though the macro is incorrect. It causes the BA to be set incorrctly
for other base addresses. This patch fixes the macro so that base
addresses other than zero can be used with the MCF5235.

Signed-off-by: Steve deRosier deros...@gmail.com
---
 arch/m68k/include/asm/m5235.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/m68k/include/asm/m5235.h b/arch/m68k/include/asm/m5235.h
index 71a40d3..a573f1c 100644
--- a/arch/m68k/include/asm/m5235.h
+++ b/arch/m68k/include/asm/m5235.h
@@ -134,7 +134,7 @@
 #define SDRAMC_DCR_RC(x)   (((x)0xFF)8)
 
 /* Bit definitions and macros for SDRAMC_DARCn */
-#define SDRAMC_DARCn_BA(x) (((x)0xFFFC)18)
+#define SDRAMC_DARCn_BA(x) ((x)0xFFFC)
 #define SDRAMC_DARCn_RE(0x8000)
 #define SDRAMC_DARCn_CASL_MASK (0x3000)
 #define SDRAMC_DARCn_CASL_C0   (0x)
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Simon Glass
Hi Stephen,

On Tue, Jan 22, 2013 at 1:26 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/22/2013 02:13 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.

 What is the intended use of this function? (sorry, yes, I am confused :-)

 It's a safer way of doing this:
 tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT
 http://lists.denx.de/pipermail/u-boot/2013-January/144612.html

 i.e. it address the concerns I raised here:
 http://lists.denx.de/pipermail/u-boot/2013-January/144713.html


OK thank you. So is your function only intended for use with T20?

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


[U-Boot] [PATCH] sandbox: fix compiler warning

2013-01-22 Thread Allen Martin
Fix compiler warning about control flow reaching end of non void
function.

Signed-off-by: Allen Martin amar...@nvidia.com
---
 arch/sandbox/cpu/start.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 7603bf9..5287fd5 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -122,4 +122,7 @@ int main(int argc, char *argv[])
 * never return.
 */
board_init_f(0);
+
+   /* NOTREACHED - board_init_f() does not return */
+   return 0;
 }
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH v2 4/7] Tegra114: Add common CPU (shared) files

2013-01-22 Thread Tom Warren
Simon,

On Tue, Jan 22, 2013 at 1:54 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 These files are used by both SPL and main U-Boot.

 Signed-off-by: Tom Warren twar...@nvidia.com
 ---
 Changes in v2:
 - update all new copyright header dates to 2013
 - use ODMDATA correctly in query_dram_size

  arch/arm/cpu/tegra-common/ap.c |9 +-
  arch/arm/cpu/tegra-common/board.c  |   21 +-
  arch/arm/cpu/tegra114-common/Makefile  |   41 ++
  arch/arm/cpu/tegra114-common/clock.c   | 1150 
 
  arch/arm/cpu/tegra114-common/funcmux.c |   63 ++
  arch/arm/cpu/tegra114-common/pinmux.c  |  506 ++
  6 files changed, 1786 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/cpu/tegra114-common/Makefile
  create mode 100644 arch/arm/cpu/tegra114-common/clock.c
  create mode 100644 arch/arm/cpu/tegra114-common/funcmux.c
  create mode 100644 arch/arm/cpu/tegra114-common/pinmux.c


 I'm a bit concerned about the code duplication here. Isn't much of
 this code common?

 Regards,
 Simon

funcmux.c differs almost entirely (different muxes for different UARTs
used on the boards). Pinmux.c differs quite a bit, mostly in tables.
And clock.c has a few minor name diffs (DVC vs I2C5), but there are
extra enums for the additional RST/ENA bits on T114, plus the
differences in clock_early_init WRT the PLL rates. And that's just for
the T30 vs. T114 differences - T20 is vastly different in it's pinmux
HW regs, and device RST/ENA bits.

I view it as a worthy exercise that could be applied after T114
baseline code is in, to see just how much more common code could be
factored out and put into arm/cpu/tegra-common, but I don't see it as
being a huge amount.  T30 and T114 would share the most code, but
where would it go? since it can't be shared w/T20?

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


Re: [U-Boot] [PATCH v2 4/7] Tegra114: Add common CPU (shared) files

2013-01-22 Thread Simon Glass
Hi Tom,

On Tue, Jan 22, 2013 at 1:37 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 Simon,

 On Tue, Jan 22, 2013 at 1:54 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 These files are used by both SPL and main U-Boot.

 Signed-off-by: Tom Warren twar...@nvidia.com
 ---
 Changes in v2:
 - update all new copyright header dates to 2013
 - use ODMDATA correctly in query_dram_size

  arch/arm/cpu/tegra-common/ap.c |9 +-
  arch/arm/cpu/tegra-common/board.c  |   21 +-
  arch/arm/cpu/tegra114-common/Makefile  |   41 ++
  arch/arm/cpu/tegra114-common/clock.c   | 1150 
 
  arch/arm/cpu/tegra114-common/funcmux.c |   63 ++
  arch/arm/cpu/tegra114-common/pinmux.c  |  506 ++
  6 files changed, 1786 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/cpu/tegra114-common/Makefile
  create mode 100644 arch/arm/cpu/tegra114-common/clock.c
  create mode 100644 arch/arm/cpu/tegra114-common/funcmux.c
  create mode 100644 arch/arm/cpu/tegra114-common/pinmux.c


 I'm a bit concerned about the code duplication here. Isn't much of
 this code common?

 Regards,
 Simon

 funcmux.c differs almost entirely (different muxes for different UARTs
 used on the boards). Pinmux.c differs quite a bit, mostly in tables.
 And clock.c has a few minor name diffs (DVC vs I2C5), but there are
 extra enums for the additional RST/ENA bits on T114, plus the
 differences in clock_early_init WRT the PLL rates. And that's just for
 the T30 vs. T114 differences - T20 is vastly different in it's pinmux
 HW regs, and device RST/ENA bits.

I suppose I was mostly thinking of clock.c - most of that code looks
very familiar.


 I view it as a worthy exercise that could be applied after T114
 baseline code is in, to see just how much more common code could be
 factored out and put into arm/cpu/tegra-common, but I don't see it as
 being a huge amount.  T30 and T114 would share the most code, but
 where would it go? since it can't be shared w/T20?

 Tom

We had the same discussion with T30. I suppose you could have clock.c
for common stuff and clock-t20.c, clock-t30.c, etc. for the extra /
unusual bits.

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


Re: [U-Boot] [PATCH v2 4/7] Tegra114: Add common CPU (shared) files

2013-01-22 Thread Tom Warren
Simon,

On Tue, Jan 22, 2013 at 2:45 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Tue, Jan 22, 2013 at 1:37 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 Simon,

 On Tue, Jan 22, 2013 at 1:54 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren twarren.nvi...@gmail.com 
 wrote:
 These files are used by both SPL and main U-Boot.

 Signed-off-by: Tom Warren twar...@nvidia.com
 ---
 Changes in v2:
 - update all new copyright header dates to 2013
 - use ODMDATA correctly in query_dram_size

  arch/arm/cpu/tegra-common/ap.c |9 +-
  arch/arm/cpu/tegra-common/board.c  |   21 +-
  arch/arm/cpu/tegra114-common/Makefile  |   41 ++
  arch/arm/cpu/tegra114-common/clock.c   | 1150 
 
  arch/arm/cpu/tegra114-common/funcmux.c |   63 ++
  arch/arm/cpu/tegra114-common/pinmux.c  |  506 ++
  6 files changed, 1786 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/cpu/tegra114-common/Makefile
  create mode 100644 arch/arm/cpu/tegra114-common/clock.c
  create mode 100644 arch/arm/cpu/tegra114-common/funcmux.c
  create mode 100644 arch/arm/cpu/tegra114-common/pinmux.c


 I'm a bit concerned about the code duplication here. Isn't much of
 this code common?

 Regards,
 Simon

 funcmux.c differs almost entirely (different muxes for different UARTs
 used on the boards). Pinmux.c differs quite a bit, mostly in tables.
 And clock.c has a few minor name diffs (DVC vs I2C5), but there are
 extra enums for the additional RST/ENA bits on T114, plus the
 differences in clock_early_init WRT the PLL rates. And that's just for
 the T30 vs. T114 differences - T20 is vastly different in it's pinmux
 HW regs, and device RST/ENA bits.

 I suppose I was mostly thinking of clock.c - most of that code looks
 very familiar.


 I view it as a worthy exercise that could be applied after T114
 baseline code is in, to see just how much more common code could be
 factored out and put into arm/cpu/tegra-common, but I don't see it as
 being a huge amount.  T30 and T114 would share the most code, but
 where would it go? since it can't be shared w/T20?

 Tom

 We had the same discussion with T30. I suppose you could have clock.c
 for common stuff and clock-t20.c, clock-t30.c, etc. for the extra /
 unusual bits.

OK, since I have to do a V3 patchset for T114 anyway, I'll take a pass
at it. But only for clock code - I don't want to get too bogged down -
there's too much backing up on the tracks behind me ;)

Tom

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


Re: [U-Boot] [PATCH v2 4/7] Tegra114: Add common CPU (shared) files

2013-01-22 Thread Simon Glass
Hi Tom,

On Tue, Jan 22, 2013 at 1:49 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 Simon,

 On Tue, Jan 22, 2013 at 2:45 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Tue, Jan 22, 2013 at 1:37 PM, Tom Warren twarren.nvi...@gmail.com wrote:
 Simon,

 On Tue, Jan 22, 2013 at 1:54 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren twarren.nvi...@gmail.com 
 wrote:
 These files are used by both SPL and main U-Boot.

 Signed-off-by: Tom Warren twar...@nvidia.com
 ---
 Changes in v2:
 - update all new copyright header dates to 2013
 - use ODMDATA correctly in query_dram_size

  arch/arm/cpu/tegra-common/ap.c |9 +-
  arch/arm/cpu/tegra-common/board.c  |   21 +-
  arch/arm/cpu/tegra114-common/Makefile  |   41 ++
  arch/arm/cpu/tegra114-common/clock.c   | 1150 
 
  arch/arm/cpu/tegra114-common/funcmux.c |   63 ++
  arch/arm/cpu/tegra114-common/pinmux.c  |  506 ++
  6 files changed, 1786 insertions(+), 4 deletions(-)
  create mode 100644 arch/arm/cpu/tegra114-common/Makefile
  create mode 100644 arch/arm/cpu/tegra114-common/clock.c
  create mode 100644 arch/arm/cpu/tegra114-common/funcmux.c
  create mode 100644 arch/arm/cpu/tegra114-common/pinmux.c


 I'm a bit concerned about the code duplication here. Isn't much of
 this code common?

 Regards,
 Simon

 funcmux.c differs almost entirely (different muxes for different UARTs
 used on the boards). Pinmux.c differs quite a bit, mostly in tables.
 And clock.c has a few minor name diffs (DVC vs I2C5), but there are
 extra enums for the additional RST/ENA bits on T114, plus the
 differences in clock_early_init WRT the PLL rates. And that's just for
 the T30 vs. T114 differences - T20 is vastly different in it's pinmux
 HW regs, and device RST/ENA bits.

 I suppose I was mostly thinking of clock.c - most of that code looks
 very familiar.


 I view it as a worthy exercise that could be applied after T114
 baseline code is in, to see just how much more common code could be
 factored out and put into arm/cpu/tegra-common, but I don't see it as
 being a huge amount.  T30 and T114 would share the most code, but
 where would it go? since it can't be shared w/T20?

 Tom

 We had the same discussion with T30. I suppose you could have clock.c
 for common stuff and clock-t20.c, clock-t30.c, etc. for the extra /
 unusual bits.

 OK, since I have to do a V3 patchset for T114 anyway, I'll take a pass
 at it. But only for clock code - I don't want to get too bogged down -
 there's too much backing up on the tracks behind me ;)

OK thanks. This sort of core code is sometimes hard to revisit later...

Regards,
Simon


 Tom

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


Re: [U-Boot] [PATCH] sandbox: fix compiler warning

2013-01-22 Thread Simon Glass
On Tue, Jan 22, 2013 at 1:42 PM, Allen Martin amar...@nvidia.com wrote:
 Fix compiler warning about control flow reaching end of non void
 function.

 Signed-off-by: Allen Martin amar...@nvidia.com

Should perhaps mention the commit that adding this warning (e05e5de7 I think)

Acked-by: Simon Glass s...@chromium.org

 ---
  arch/sandbox/cpu/start.c |3 +++
  1 file changed, 3 insertions(+)

 diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
 index 7603bf9..5287fd5 100644
 --- a/arch/sandbox/cpu/start.c
 +++ b/arch/sandbox/cpu/start.c
 @@ -122,4 +122,7 @@ int main(int argc, char *argv[])
  * never return.
  */
 board_init_f(0);
 +
 +   /* NOTREACHED - board_init_f() does not return */
 +   return 0;
  }
 --
 1.7.10.4

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


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Stephen Warren
On 01/22/2013 02:42 PM, Simon Glass wrote:
 Hi Stephen,
 
 On Tue, Jan 22, 2013 at 1:26 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/22/2013 02:13 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.

 What is the intended use of this function? (sorry, yes, I am confused :-)

 It's a safer way of doing this:
 tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT
 http://lists.denx.de/pipermail/u-boot/2013-January/144612.html

 i.e. it address the concerns I raised here:
 http://lists.denx.de/pipermail/u-boot/2013-January/144713.html

 
 OK thank you. So is your function only intended for use with T20?

No, I imagine that it should be used for all Tegras; I just wrote it
long enough ago that there was only Tegra20 at the time. I assume that
if Lucas wants to use this function as a pre-cursor to his NAND pinmux
change, he'll update it for whatever Tegra versions are checked in at
the time first.

Sorry, I'm being lazy/over-worked.

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


Re: [U-Boot] [PATCH] tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT

2013-01-22 Thread Lucas Stach
Am Dienstag, den 22.01.2013, 09:24 -0700 schrieb Stephen Warren:
 On 01/21/2013 05:20 PM, Lucas Stach wrote:
  Even the 8bit case needs KBCB configured, as pin D7 is located in this
  pingroup. Also pingroup ATC seems to come out of reset with config set
  to NAND, so we need to explictly configure some other function to this
  group in order to avoid clashing settings.
 
  diff --git a/arch/arm/cpu/tegra20-common/funcmux.c 
  b/arch/arm/cpu/tegra20-common/funcmux.c
 
  @@ -266,17 +266,25 @@ int funcmux_select(enum periph_id id, int config)
  break;
  case FUNCMUX_NDFLASH_KBC_8_BIT:
 ...
  +   /*
  +* configure pingroup ATC to something unrelated to
  +* avoid ATC overriding KBC
  +*/
  +   pinmux_set_func(PINGRP_ATC, PMUX_FUNC_GMI);
  +
 
 This gets a bit dangerous; what if pingroup ATC was already configured
 for some function other than NAND or GMI? This code will then break that
 setting. I would suggest one of the following alternatives:
 
 1) Use the new pinmux_avoid_func() function implemented in the patch
 that I just sent.
 
 2) Move Tegra20 over to the new board-wide pinmux style that Tegra30
 uses, where the entire pinmux is initialized in one shot. This will
 completely avoid any kind of uninitialized pinmux settings, and to some
 extent is the only sensible thing to do on a device like Tegra which has
 the potential for conflicts like this patch tries to avoid.
 
I'll take a look on how much work it is to implement option #2. If it
isn't too much and I find some time in this U-Boot release cycle, I'm
very much inclined to do this the ultimately right way.

Regards,
Lucas

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


[U-Boot] [PATCH v4 2/2] amcore: add support for amcore board

2013-01-22 Thread Angelo Dureghello
Signed-off-by: Angelo Dureghello sysa...@gmail.com
Cc: Jason Jin jason@freescale.com
---
Changes for v2:
- None
Changes for v3:
- Fix code format issues
Changes for v4:
- Added MAINTAINERS file entry
- Removed all unnecessary blank lines 
- Added get_ram_size in sdram init 
- Reused already existing sdram test routine
- Removed custom flash.c, used std mtd/CFI driver
---
 MAINTAINERS|4 +
 board/sysam/amcore/Makefile|   43 ++
 board/sysam/amcore/amcore.c|  160 +
 board/sysam/amcore/config.mk   |   23 +++
 board/sysam/amcore/u-boot.lds  |  101 ++
 boards.cfg |1 +
 include/configs/amcore.h   |  220 +
 7 files changed, 552 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 28c052d..1d27cb7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1137,6 +1137,10 @@ Wolfgang Wegner w.weg...@astro-kom.de
 
astro_mcf5373l  MCF5373L
 
+Angelo Dureghello sysa...@gmail.com
+
+   amcore  mcf5307
+
 #
 # AVR32 Systems:   #
 #  #
diff --git a/arch/m68k/cpu/mcf530x/Makefile b/arch/m68k/cpu/mcf530x/Makefile
new file mode 100644
index 000..3c5a1c2
--- /dev/null
+++ b/arch/m68k/cpu/mcf530x/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2011 Angelo Dureghello sysa...@gmail.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+# CFLAGS += -DET_DEBUG
+
+LIB= $(obj)lib$(CPU).o
+
+START  = start.o
+COBJS  = interrupts.o cpu.o speed.o cpu_init.o
+
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/m68k/cpu/mcf530x/config.mk b/arch/m68k/cpu/mcf530x/config.mk
new file mode 100644
index 000..924cd7f
--- /dev/null
+++ b/arch/m68k/cpu/mcf530x/config.mk
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2012 Angelo Dureghello sysa...@gmail.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
+
+cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 
's/.*\(configs.*\)/\1/')
+is5307:=$(shell grep CONFIG_M5307 $(TOPDIR)/include/$(cfg))
+
+ifneq (,$(findstring CONFIG_M5307,$(is5307)))
+PLATFORM_CPPFLAGS += -mcpu=5307
+endif
diff --git a/arch/m68k/cpu/mcf530x/cpu.c b/arch/m68k/cpu/mcf530x/cpu.c
new file mode 100644
index 000..5aac085
--- /dev/null
+++ b/arch/m68k/cpu/mcf530x/cpu.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2012 Angelo Dureghello sysa...@gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be 

[U-Boot] [PATCH v4 1/2] m68k: add support for mcf5307 cpu

2013-01-22 Thread Angelo Dureghello
Add support for freescale coldfire mcf5307 cpu.

Signed-off-by: Angelo Dureghello sysa...@gmail.com
Cc: Jason Jin jason@freescale.com
---
Changes for v2:
- Add MAINTAINERS entry
- Add boards.cfg entry
Changes for v3:
- Fix code format issues
Changes for v4:
- Removed MAINTAINERS file / entry
- Fixed macroes adding do {} while(0)
- Removed volatile
- Accessing cpu registers through structures/pointers
---
 arch/m68k/cpu/mcf530x/Makefile |   48 +++
 arch/m68k/cpu/mcf530x/config.mk|   30 
 arch/m68k/cpu/mcf530x/cpu.c|   53 +++
 arch/m68k/cpu/mcf530x/cpu.h|   33 +
 arch/m68k/cpu/mcf530x/cpu_init.c   |  175 +++
 arch/m68k/cpu/mcf530x/interrupts.c |   44 ++
 arch/m68k/cpu/mcf530x/speed.c  |   38 +
 arch/m68k/cpu/mcf530x/start.S  |  271 
 arch/m68k/include/asm/cache.h  |3 +-
 arch/m68k/include/asm/immap.h  |   23 +++
 arch/m68k/include/asm/immap_5307.h |  135 ++
 arch/m68k/include/asm/m5307.h  |   87 
 arch/m68k/include/asm/timer.h  |3 +-
 arch/m68k/lib/time.c   |1 +
 14 files changed, 942 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/cpu/mcf530x/Makefile b/arch/m68k/cpu/mcf530x/Makefile
new file mode 100644
index 000..3c5a1c2
--- /dev/null
+++ b/arch/m68k/cpu/mcf530x/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2011 Angelo Dureghello sysa...@gmail.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+# CFLAGS += -DET_DEBUG
+
+LIB= $(obj)lib$(CPU).o
+
+START  = start.o
+COBJS  = interrupts.o cpu.o speed.o cpu_init.o
+
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/m68k/cpu/mcf530x/config.mk b/arch/m68k/cpu/mcf530x/config.mk
new file mode 100644
index 000..924cd7f
--- /dev/null
+++ b/arch/m68k/cpu/mcf530x/config.mk
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2012 Angelo Dureghello sysa...@gmail.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
+
+cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 
's/.*\(configs.*\)/\1/')
+is5307:=$(shell grep CONFIG_M5307 $(TOPDIR)/include/$(cfg))
+
+ifneq (,$(findstring CONFIG_M5307,$(is5307)))
+PLATFORM_CPPFLAGS += -mcpu=5307
+endif
diff --git a/arch/m68k/cpu/mcf530x/cpu.c b/arch/m68k/cpu/mcf530x/cpu.c
new file mode 100644
index 000..5aac085
--- /dev/null
+++ b/arch/m68k/cpu/mcf530x/cpu.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2012 Angelo Dureghello sysa...@gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or 

Re: [U-Boot] [PATCH] sandbox: fix compiler warning

2013-01-22 Thread Allen Martin
On Tue, Jan 22, 2013 at 01:56:23PM -0800, Simon Glass wrote:
 On Tue, Jan 22, 2013 at 1:42 PM, Allen Martin amar...@nvidia.com wrote:
  Fix compiler warning about control flow reaching end of non void
  function.
 
  Signed-off-by: Allen Martin amar...@nvidia.com
 
 Should perhaps mention the commit that adding this warning (e05e5de7 I think)
 
 Acked-by: Simon Glass s...@chromium.org
 

It was this commit:

commit fec79acc864bed049b6beae719ccbf2bbec5403a
Author: Mike Frysinger vap...@gentoo.org
Date:   Wed Oct 26 00:22:14 2011 +

sandbox: drop unused return

Signed-off-by: Mike Frysinger vap...@gentoo.org
Acked-by: Simon Glass s...@chromium.org


I'll change the commit messagen and repost and cc Mike as well.


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


[U-Boot] [PATCH v2] sandbox: fix compiler warning

2013-01-22 Thread Allen Martin
Add back return statement to fix compiler warning about control flow
reaching end of non void function that was introduced with:

 fec79ac sandbox: drop unused return

Signed-off-by: Allen Martin amar...@nvidia.com
Acked-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/start.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 7603bf9..5287fd5 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -122,4 +122,7 @@ int main(int argc, char *argv[])
 * never return.
 */
board_init_f(0);
+
+   /* NOTREACHED - board_init_f() does not return */
+   return 0;
 }
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH] sandbox: fix compiler warning

2013-01-22 Thread Simon Glass
Hi Allen,

On Tue, Jan 22, 2013 at 2:48 PM, Allen Martin amar...@nvidia.com wrote:
 On Tue, Jan 22, 2013 at 01:56:23PM -0800, Simon Glass wrote:
 On Tue, Jan 22, 2013 at 1:42 PM, Allen Martin amar...@nvidia.com wrote:
  Fix compiler warning about control flow reaching end of non void
  function.
 
  Signed-off-by: Allen Martin amar...@nvidia.com

 Should perhaps mention the commit that adding this warning (e05e5de7 I think)

 Acked-by: Simon Glass s...@chromium.org


 It was this commit:

 commit fec79acc864bed049b6beae719ccbf2bbec5403a
 Author: Mike Frysinger vap...@gentoo.org
 Date:   Wed Oct 26 00:22:14 2011 +

 sandbox: drop unused return

 Signed-off-by: Mike Frysinger vap...@gentoo.org
 Acked-by: Simon Glass s...@chromium.org


 I'll change the commit messagen and repost and cc Mike as well.

Actually I think that Mike's commit was correct at the time, and it
was Albert's which changed the no-return behaviour of the function
signature in common.h?



 -Allen
 --
 nvpublic

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


[U-Boot] [PATCH 1/1] am335x_evm: Add am335x_evm_usbspl boot target

2013-01-22 Thread Tom Rini
With USB SPL support, we need to trim out some features in order to fit
within our memory constraints.  To allow for the most re-use of the
resulting binary, we drop out CPSW ethernet and UART support, along with
the extra environment settings as those are unused by SPL.

Signed-off-by: Tom Rini tr...@ti.com
---
 boards.cfg   |1 +
 include/configs/am335x_evm.h |7 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/boards.cfg b/boards.cfg
index b519bc4..fb0b9ac 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -236,6 +236,7 @@ am335x_evm_uart2 arm armv7   am335x 
 ti
 am335x_evm_uart3 arm armv7   am335x  ti
 am33xx  am335x_evm:SERIAL4,CONS_INDEX=4
 am335x_evm_uart4 arm armv7   am335x  ti
 am33xx  am335x_evm:SERIAL5,CONS_INDEX=5
 am335x_evm_uart5 arm armv7   am335x  ti
 am33xx  am335x_evm:SERIAL6,CONS_INDEX=6
+am335x_evm_usbsplarm armv7   am335x  ti
 am33xx  am335x_evm:SERIAL1,CONS_INDEX=1,SPL_USBETH_SUPPORT
 highbank arm armv7   highbank- 
 highbank
 mx51_efikamx arm armv7   mx51_efikamx
genesi mx5
mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKAMX,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_mx.cfg
 mx51_efikasb arm armv7   mx51_efikamx
genesi mx5
mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKASB,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_sb.cfg
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 391f705..f35ab82 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -239,7 +239,6 @@
 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x2
 #define CONFIG_SYS_SPI_U_BOOT_SIZE 0x4
 #define CONFIG_SPL_MUSB_NEW_SUPPORT
-#define CONFIG_SPL_USBETH_SUPPORT
 #define CONFIG_SPL_LDSCRIPT$(CPUDIR)/omap-common/u-boot-spl.lds
 
 #define CONFIG_SPL_BOARD_INIT
@@ -320,6 +319,12 @@
 #ifdef CONFIG_SPL_BUILD
 /* disable host part of MUSB in SPL */
 #undef CONFIG_MUSB_HOST
+/* Disable SPI and CPSW ethernet support so we can fit. */
+#ifdef CONFIG_SPL_USBETH_SUPPORT
+#undef CONFIG_SPL_ETH_SUPPORT
+#undef CONFIG_SPL_YMODEM_SUPPORT
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#endif
 #endif
 
 /* Unsupported features */
-- 
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] sandbox: fix compiler warning

2013-01-22 Thread Allen Martin
On Tue, Jan 22, 2013 at 02:58:58PM -0800, Simon Glass wrote:
 Hi Allen,
 
 On Tue, Jan 22, 2013 at 2:48 PM, Allen Martin amar...@nvidia.com wrote:
  On Tue, Jan 22, 2013 at 01:56:23PM -0800, Simon Glass wrote:
  On Tue, Jan 22, 2013 at 1:42 PM, Allen Martin amar...@nvidia.com wrote:
   Fix compiler warning about control flow reaching end of non void
   function.
  
   Signed-off-by: Allen Martin amar...@nvidia.com
 
  Should perhaps mention the commit that adding this warning (e05e5de7 I 
  think)
 
  Acked-by: Simon Glass s...@chromium.org
 
 
  It was this commit:
 
  commit fec79acc864bed049b6beae719ccbf2bbec5403a
  Author: Mike Frysinger vap...@gentoo.org
  Date:   Wed Oct 26 00:22:14 2011 +
 
  sandbox: drop unused return
 
  Signed-off-by: Mike Frysinger vap...@gentoo.org
  Acked-by: Simon Glass s...@chromium.org
 
 
  I'll change the commit messagen and repost and cc Mike as well.
 
 Actually I think that Mike's commit was correct at the time, and it
 was Albert's which changed the no-return behaviour of the function
 signature in common.h?

Oh I see, you're right.  I'll resend.

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


[U-Boot] [PATCH v3] sandbox: fix compiler warning

2013-01-22 Thread Allen Martin
Add back return statement to fix compiler warning about control flow
reaching end of non void function that was introduced with:

e05e5de arm: move C runtime setup code in crt0.S

Signed-off-by: Allen Martin amar...@nvidia.com
Acked-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/start.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 7603bf9..5287fd5 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -122,4 +122,7 @@ int main(int argc, char *argv[])
 * never return.
 */
board_init_f(0);
+
+   /* NOTREACHED - board_init_f() does not return */
+   return 0;
 }
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH V3 0/9] separate miiphy from ethernet

2013-01-22 Thread Troy Kisky

On 11/10/2012 12:28 AM, Stefano Babic wrote:

On 23/10/2012 04:40, Troy Kisky wrote:

This series tries to separate the mii regsisters
from the ethernet registers as suggested by
Andy Fleming. Then, mx6qsabrelite is changed
to find the phy address from the possibles 4-7.

The V3 series is very different from V2.

Troy Kisky (9):
   doc/README.fec_mxc: add documentation
   net: fec_mxc: delete CONFIG_FEC_MXC_MULTI
   net: fec_mxc: change fec_mii_setspeed parameter
   net: fec_mxc: have fecmxc_initialize call fecmxc_initialize_multi
   phy: add phy_find_by_mask/phy_connect_dev
   net: fec_mxc: use fec_set_dev_name to set name
   net: fec_mxc: only call phy_connect in fec_probe
   net: fec_mxc: get phydev before fec_probe
   mx6qsabrelite: search mii phy address 4-7


Hi Joe,


  board/freescale/mx6qsabrelite/mx6qsabrelite.c |   24 +++-
  doc/README.fec_mxc|   27 
  drivers/net/fec_mxc.c |  164 ++---
  drivers/net/fec_mxc.h |2 +-
  drivers/net/phy/phy.c |  128 +++
  include/configs/m28evk.h  |1 -
  include/configs/mx28evk.h |1 -
  include/configs/sc_sps_1.h|1 -
  include/netdev.h  |7 ++
  include/phy.h |3 +
  10 files changed, 227 insertions(+), 131 deletions(-)
  create mode 100644 doc/README.fec_mxc

Patches are assigned to me in patchworks. Do you have any issue with
this patchset ? If it is ok for you, I will apply it to u-boot-imx.

Best regards,
Stefano




Who should I pester to see some progress on this ?


Thanks
Troy

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


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Simon Glass
Hi Stephen,

On Tue, Jan 22, 2013 at 2:14 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/22/2013 02:42 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 1:26 PM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 On 01/22/2013 02:13 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.

 What is the intended use of this function? (sorry, yes, I am confused :-)

 It's a safer way of doing this:
 tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT
 http://lists.denx.de/pipermail/u-boot/2013-January/144612.html

 i.e. it address the concerns I raised here:
 http://lists.denx.de/pipermail/u-boot/2013-January/144713.html


 OK thank you. So is your function only intended for use with T20?

 No, I imagine that it should be used for all Tegras; I just wrote it
 long enough ago that there was only Tegra20 at the time. I assume that
 if Lucas wants to use this function as a pre-cursor to his NAND pinmux
 change, he'll update it for whatever Tegra versions are checked in at
 the time first.

Thanks, I get it.

Should Lucas consider adding a warning or some sort of indication that
the function did nothing?

 Sorry, I'm being lazy/over-worked.

:-)

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


Re: [U-Boot] [PATCH V5 02/10] EXYNOS5: FDT: Add DWMMC device node data

2013-01-22 Thread Simon Glass
Hi Amar,

On Mon, Jan 21, 2013 at 3:43 AM, Amar amarendra...@samsung.com wrote:
 This patch adds DWMMC device node data for exynos5.
 This patch also adds binding file for DWMMC device node.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 Signed-off-by: Amar amarendra...@samsung.com

Acked-by: Simon Glass s...@chromium.org

Can I suggest in a later patch you add a removable flag, so we can
mark devices which cannot be removed (and can be assumed to be
present). I believe that there is some overhead involved in detecting
an MMC (we have to try SD first, and fail).

 ---
 Changes since V1:
 1)Added binding file for DWMMC device node at the location
 doc/device-tree-bindings/exynos/dwmmc.txt.
 2)Removed the propname 'index' from device node.
 3)Prefixed the vendor name 'samsung' before propname in device node.

 Changes since V2:
 1)Updation of commit message and resubmition of proper patch set.

 Changes since V3:
 No change.

 Changes since V4:
 1)Updated the doc/device-tree-bindings/exynos/dwmmc.txt with more
 information regarding the property 'samsung,timing'.
 2)Replaced the name 'dwmmc' with 'mmc'.

  arch/arm/dts/exynos5250.dtsi  | 31 +++
  board/samsung/dts/exynos5250-smdk5250.dts | 22 ++
  doc/device-tree-bindings/exynos/dwmmc.txt | 49 
 +++
  3 files changed, 102 insertions(+)
  create mode 100644 doc/device-tree-bindings/exynos/dwmmc.txt

 diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
 index ed8c8dd..6c08eb7 100644
 --- a/arch/arm/dts/exynos5250.dtsi
 +++ b/arch/arm/dts/exynos5250.dtsi
 @@ -151,4 +151,35 @@
 };
 };

 +   mmc@1220 {
 +   #address-cells = 1;
 +   #size-cells = 0;
 +   compatible = samsung,exynos5250-dwmmc;
 +   reg = 0x1220 0x1000;
 +   interrupts = 0 75 0;
 +   };
 +
 +   mmc@1221 {
 +   #address-cells = 1;
 +   #size-cells = 0;
 +   compatible = samsung,exynos5250-dwmmc;
 +   reg = 0x1221 0x1000;
 +   interrupts = 0 76 0;
 +   };
 +
 +   mmc@1222 {
 +   #address-cells = 1;
 +   #size-cells = 0;
 +   compatible = samsung,exynos5250-dwmmc;
 +   reg = 0x1222 0x1000;
 +   interrupts = 0 77 0;
 +   };
 +
 +   mmc@1223 {
 +   #address-cells = 1;
 +   #size-cells = 0;
 +   compatible = samsung,exynos5250-dwmmc;
 +   reg = 0x1223 0x1000;
 +   interrupts = 0 78 0;
 +   };
  };
 diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
 b/board/samsung/dts/exynos5250-smdk5250.dts
 index cbfab6f..1d3e42b 100644
 --- a/board/samsung/dts/exynos5250-smdk5250.dts
 +++ b/board/samsung/dts/exynos5250-smdk5250.dts
 @@ -30,6 +30,10 @@
 spi2 = /spi@12d4;
 spi3 = /spi@131a;
 spi4 = /spi@131b;
 +   mmc0 = /mmc@1220;
 +   mmc1 = /mmc@1221;
 +   mmc2 = /mmc@1222;
 +   mmc3 = /mmc@1223;
 };

 sromc@1225 {
 @@ -66,4 +70,22 @@
 compatible = maxim,max77686_pmic;
 };
 };
 +
 +   mmc@1220 {
 +   samsung,bus-width = 8;
 +   samsung,timing = 1 3 3;
 +   };
 +
 +   mmc@1221 {
 +   status = disabled;
 +   };
 +
 +   mmc@1222 {
 +   samsung,bus-width = 4;
 +   samsung,timing = 1 2 3;
 +   };
 +
 +   mmc@1223 {
 +   status = disabled;
 +   };
  };
 diff --git a/doc/device-tree-bindings/exynos/dwmmc.txt 
 b/doc/device-tree-bindings/exynos/dwmmc.txt
 new file mode 100644
 index 000..0054ace
 --- /dev/null
 +++ b/doc/device-tree-bindings/exynos/dwmmc.txt
 @@ -0,0 +1,49 @@
 +* Exynos 5250 DWC_mobile_storage
 +
 +The Exynos 5250 provides DWC_mobile_storage interface which supports
 +. Embedded Multimedia Cards (EMMC-version 4.5)
 +. Secure Digital memory (SD mem-version 2.0)
 +. Secure Digital I/O (SDIO-version 3.0)
 +. Consumer Electronics Advanced Transport Architecture (CE-ATA-version 1.1)
 +
 +The Exynos 5250 DWC_mobile_storage provides four channels.
 +SOC specific and Board specific properties are channel specific.
 +
 +Required SoC Specific Properties:
 +
 +- compatible: should be
 +   - samsung,exynos5250-dwmmc: for exynos5250 platforms
 +
 +- reg: physical base address of the controller and length of memory mapped
 +   region.
 +
 +- interrupts: The interrupt number to the cpu.
 +
 +Required Board Specific Properties:
 +
 +- #address-cells: should be 1.
 +- #size-cells: should be 0.
 +- samsung,bus-width: The width of the bus used to interface the devices
 +   supported by DWC_mobile_storage 

[U-Boot] [PATCH] MAKEALL: fix kill_children for BSD hosts

2013-01-22 Thread Andreas Bießmann
ps on BSD hosts (like OS X) do not provide the --no-headers switch nor
understand the AIX format descriptions. Make the call for ps portable and filter
the relevant line from output (including the header) with sed.
Also switch from pgrep to ps to get the list of children and use the same
mechanism as for pgid.

This patch makes the MAKEALL script cleanly stoppable on bare OS X when using
the parallel builds of targets.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
Cc: Joe Hershberger joe.hershber...@ni.com
---
 MAKEALL | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 5b06c54..d926846 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -784,8 +784,8 @@ build_targets() {
 #---
 
 kill_children() {
-   local pgid=`ps -p $$ --no-headers -o %r | tr -d ' '`
-   local children=`pgrep -g $pgid | grep -v $$ | grep -v $pgid`
+   local pgid=`ps -p $$ -o pgid | sed -e /PGID/d`
+   local children=`ps -g $pgid -o pid | sed -e /PID\|$$\|$pgid/d`
 
kill $children 2 /dev/null
wait $children 2 /dev/null
-- 
1.8.1.1

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


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Stephen Warren
On 01/22/2013 05:03 PM, Simon Glass wrote:
 Hi Stephen,
 
 On Tue, Jan 22, 2013 at 2:14 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/22/2013 02:42 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 1:26 PM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 On 01/22/2013 02:13 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.

 What is the intended use of this function? (sorry, yes, I am confused :-)

 It's a safer way of doing this:
 tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT
 http://lists.denx.de/pipermail/u-boot/2013-January/144612.html

 i.e. it address the concerns I raised here:
 http://lists.denx.de/pipermail/u-boot/2013-January/144713.html


 OK thank you. So is your function only intended for use with T20?

 No, I imagine that it should be used for all Tegras; I just wrote it
 long enough ago that there was only Tegra20 at the time. I assume that
 if Lucas wants to use this function as a pre-cursor to his NAND pinmux
 change, he'll update it for whatever Tegra versions are checked in at
 the time first.

 Thanks, I get it.
 
 Should Lucas consider adding a warning or some sort of indication that
 the function did nothing?

Do you mean on Tegra30 where it isn't implemented yet (no - I'd expect
to see this implemented instead) or when the current function programmed
into HW already doesn't match the value one is trying to avoid (no - I'd
expect this to be quite common).

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


Re: [U-Boot] [PATCH V5 03/10] DWMMC: Initialise dwmci and resolve EMMC read write issues

2013-01-22 Thread Simon Glass
On Mon, Jan 21, 2013 at 3:43 AM, Amar amarendra...@samsung.com wrote:
 This patch enumerates dwmci and set auto stop command during
 dwmci initialisation.
 EMMC read/write is not happening in current implementation
 due to improper fifo size computation. Hence Modified the fifo size
 computation to resolve EMMC read write issues.

 Signed-off-by: Amar amarendra...@samsung.com

Acked-by: Simon Glass s...@chromium.org

(nit below if you resend for other reason)

 ---
 Changes since V1:
 1)Created the macros RX_WMARK_SHIFT and RX_WMARK_MASK in header file.

 Changes since V2:
 1)Updation of commit message and resubmition of proper patch set.

 Changes since V3:
 1)Updated to use the macro DWMCI_CTRL_SEND_AS_CCSD instead of
 the hard coded value (1  10).

 Changes since V4:
 1)Updated the function dwmci_send_cmd() to use get_timer() instead
 of using mdelay(1).

  drivers/mmc/dw_mmc.c | 23 ---
  1 file changed, 16 insertions(+), 7 deletions(-)

 diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
 index 4070d4e..391ed93 100644
 --- a/drivers/mmc/dw_mmc.c
 +++ b/drivers/mmc/dw_mmc.c

 @@ -323,6 +322,14 @@ static int dwmci_init(struct mmc *mmc)
 return -1;
 }

 +   /* Enumerate at 400KHz */
 +   dwmci_setup_bus(host, mmc-f_min);
 +
 +   /* Set auto stop command */
 +   ier = dwmci_readl(host, DWMCI_CTRL);
 +   ier |= DWMCI_CTRL_SEND_AS_CCSD;
 +   dwmci_writel(host, DWMCI_CTRL, ier);
 +
 dwmci_writel(host, DWMCI_RINTSTS, 0x);
 dwmci_writel(host, DWMCI_INTMASK, 0);

 @@ -332,11 +339,13 @@ static int dwmci_init(struct mmc *mmc)
 dwmci_writel(host, DWMCI_BMOD, 1);

 fifo_size = dwmci_readl(host, DWMCI_FIFOTH);
 +   fifo_size = ((fifo_size  RX_WMARK_MASK)  RX_WMARK_SHIFT) + 1;
 if (host-fifoth_val)
 fifoth_val = host-fifoth_val;

should be {} around this I think.

 -   else
 -   fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size/2 -1) |
 -   TX_WMARK(fifo_size/2);
 +   else {
 +   fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) |
 +   TX_WMARK(fifo_size / 2);
 +   }
 dwmci_writel(host, DWMCI_FIFOTH, fifoth_val);

 dwmci_writel(host, DWMCI_CLKENA, 0);
 --
 1.8.0

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


Re: [U-Boot] [PATCH] tegra: implement pinmux_avoid_func()

2013-01-22 Thread Simon Glass
Hi Stephen,

On Tue, Jan 22, 2013 at 4:21 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 01/22/2013 05:03 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 2:14 PM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 On 01/22/2013 02:42 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 1:26 PM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 On 01/22/2013 02:13 PM, Simon Glass wrote:
 Hi Stephen,

 On Tue, Jan 22, 2013 at 8:21 AM, Stephen Warren swar...@wwwdotorg.org 
 wrote:
 From: Stephen Warren swar...@nvidia.com

 This selects the safe (non-conflicting) mux function for a pin group
 if the current setting matches the specified function.

 Many signals can be routed to or from multiple different groups. Each
 signal must be routed to or from only a single group at a given time.
 Hence, if we program a particular group for a function, we must ensure
 no other group is programmed to that same function first. This API
 makes this easy.

 What is the intended use of this function? (sorry, yes, I am confused :-)

 It's a safer way of doing this:
 tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT
 http://lists.denx.de/pipermail/u-boot/2013-January/144612.html

 i.e. it address the concerns I raised here:
 http://lists.denx.de/pipermail/u-boot/2013-January/144713.html


 OK thank you. So is your function only intended for use with T20?

 No, I imagine that it should be used for all Tegras; I just wrote it
 long enough ago that there was only Tegra20 at the time. I assume that
 if Lucas wants to use this function as a pre-cursor to his NAND pinmux
 change, he'll update it for whatever Tegra versions are checked in at
 the time first.

 Thanks, I get it.

 Should Lucas consider adding a warning or some sort of indication that
 the function did nothing?

 Do you mean on Tegra30 where it isn't implemented yet (no - I'd expect
 to see this implemented instead) or when the current function programmed
 into HW already doesn't match the value one is trying to avoid (no - I'd
 expect this to be quite common).


The latter - ok that's fine.

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


[U-Boot] [PATCH 6/6] mxs: mmc: mx23_olinuxino: Add MMC support

2013-01-22 Thread Marek Vasut
Add support for the MMC attached to SSP1.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Otavio Salvador ota...@ossystems.com.br
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
---
 board/olimex/mx23_olinuxino/mx23_olinuxino.c |   22 +-
 board/olimex/mx23_olinuxino/spl_boot.c   |9 +
 include/configs/mx23_olinuxino.h |   12 
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c 
b/board/olimex/mx23_olinuxino/mx23_olinuxino.c
index 2fcad26..6a6053b 100644
--- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c
+++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c
@@ -23,7 +23,10 @@
  */
 
 #include common.h
+#include asm/io.h
+#include asm/arch/iomux-mx23.h
 #include asm/arch/imx-regs.h
+#include asm/arch/clock.h
 #include asm/arch/sys_proto.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -33,7 +36,12 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int board_early_init_f(void)
 {
-   /* SSP clock init will come here soon. */
+   /* IO0 clock at 480MHz */
+   mxs_set_ioclk(MXC_IOCLK0, 48);
+
+   /* SSP0 clock at 96MHz */
+   mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
+
return 0;
 }
 
@@ -42,6 +50,18 @@ int dram_init(void)
return mxs_dram_init();
 }
 
+#ifdef CONFIG_CMD_MMC
+static int mx23_olx_mmc_cd(int id)
+{
+   return 1;   /* Card always present */
+}
+
+int board_mmc_init(bd_t *bis)
+{
+   return mxsmmc_initialize(bis, 0, NULL, mx23_olx_mmc_cd);
+}
+#endif
+
 int board_init(void)
 {
/* Adress of boot parameters */
diff --git a/board/olimex/mx23_olinuxino/spl_boot.c 
b/board/olimex/mx23_olinuxino/spl_boot.c
index 6cf669f..7def8bc 100644
--- a/board/olimex/mx23_olinuxino/spl_boot.c
+++ b/board/olimex/mx23_olinuxino/spl_boot.c
@@ -30,6 +30,7 @@
 #include asm/arch/sys_proto.h
 
 #defineMUX_CONFIG_EMI  (MXS_PAD_3V3 | MXS_PAD_16MA | MXS_PAD_PULLUP)
+#defineMUX_CONFIG_SSP  (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
 
 const iomux_cfg_t iomux_setup[] = {
/* DUART */
@@ -82,6 +83,14 @@ const iomux_cfg_t iomux_setup[] = {
MX23_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI,
MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI,
+
+   /* MMC 0 */
+   MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP,
+   MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP,
+   MX23_PAD_SSP1_DATA1__SSP1_DATA1 | MUX_CONFIG_SSP,
+   MX23_PAD_SSP1_DATA2__SSP1_DATA2 | MUX_CONFIG_SSP,
+   MX23_PAD_SSP1_DATA3__SSP1_DATA3 | MUX_CONFIG_SSP,
+   MX23_PAD_SSP1_SCK__SSP1_SCK | MUX_CONFIG_SSP,
 };
 
 void board_init_ll(void)
diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
index e5e718c..bc63481 100644
--- a/include/configs/mx23_olinuxino.h
+++ b/include/configs/mx23_olinuxino.h
@@ -53,8 +53,10 @@
 #defineCONFIG_DOS_PARTITION
 
 #defineCONFIG_CMD_CACHE
+#defineCONFIG_CMD_EXT2
 #defineCONFIG_CMD_FAT
 #defineCONFIG_CMD_GPIO
+#defineCONFIG_CMD_MMC
 
 /*
  * Memory configurations
@@ -110,6 +112,16 @@
 #defineCONFIG_BAUDRATE 115200  /* Default baud rate */
 
 /*
+ * MMC Driver
+ */
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_BOUNCE_BUFFER
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MXS_MMC
+#endif
+
+/*
  * APBH DMA
  */
 #define CONFIG_APBH_DMA
-- 
1.7.10.4

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


[U-Boot] [PATCH 1/6] mxs: dma: Fix APBH DMA driver for MX23

2013-01-22 Thread Marek Vasut
The MX23 has less channels for the APBH DMA, sligtly different register
layout and some bits in those registers are placed differently. Reflect
this in the driver. This patch fixes MMC/DMA issue on MX23.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Otavio Salvador ota...@ossystems.com.br
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
---
 arch/arm/include/asm/arch-mxs/regs-apbh.h |  121 +
 drivers/dma/apbh_dma.c|   10 ++-
 2 files changed, 129 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-mxs/regs-apbh.h 
b/arch/arm/include/asm/arch-mxs/regs-apbh.h
index e18e677..fcef4b8 100644
--- a/arch/arm/include/asm/arch-mxs/regs-apbh.h
+++ b/arch/arm/include/asm/arch-mxs/regs-apbh.h
@@ -29,6 +29,87 @@
 #include asm/arch/regs-common.h
 
 #ifndef__ASSEMBLY__
+
+#if defined(CONFIG_MX23)
+struct mxs_apbh_regs {
+   mxs_reg_32(hw_apbh_ctrl0)
+   mxs_reg_32(hw_apbh_ctrl1)
+   mxs_reg_32(hw_apbh_ctrl2)
+   mxs_reg_32(hw_apbh_channel_ctrl)
+
+   union {
+   struct {
+   mxs_reg_32(hw_apbh_ch_curcmdar)
+   mxs_reg_32(hw_apbh_ch_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch_cmd)
+   mxs_reg_32(hw_apbh_ch_bar)
+   mxs_reg_32(hw_apbh_ch_sema)
+   mxs_reg_32(hw_apbh_ch_debug1)
+   mxs_reg_32(hw_apbh_ch_debug2)
+   } ch[8];
+   struct {
+   mxs_reg_32(hw_apbh_ch0_curcmdar)
+   mxs_reg_32(hw_apbh_ch0_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch0_cmd)
+   mxs_reg_32(hw_apbh_ch0_bar)
+   mxs_reg_32(hw_apbh_ch0_sema)
+   mxs_reg_32(hw_apbh_ch0_debug1)
+   mxs_reg_32(hw_apbh_ch0_debug2)
+   mxs_reg_32(hw_apbh_ch1_curcmdar)
+   mxs_reg_32(hw_apbh_ch1_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch1_cmd)
+   mxs_reg_32(hw_apbh_ch1_bar)
+   mxs_reg_32(hw_apbh_ch1_sema)
+   mxs_reg_32(hw_apbh_ch1_debug1)
+   mxs_reg_32(hw_apbh_ch1_debug2)
+   mxs_reg_32(hw_apbh_ch2_curcmdar)
+   mxs_reg_32(hw_apbh_ch2_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch2_cmd)
+   mxs_reg_32(hw_apbh_ch2_bar)
+   mxs_reg_32(hw_apbh_ch2_sema)
+   mxs_reg_32(hw_apbh_ch2_debug1)
+   mxs_reg_32(hw_apbh_ch2_debug2)
+   mxs_reg_32(hw_apbh_ch3_curcmdar)
+   mxs_reg_32(hw_apbh_ch3_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch3_cmd)
+   mxs_reg_32(hw_apbh_ch3_bar)
+   mxs_reg_32(hw_apbh_ch3_sema)
+   mxs_reg_32(hw_apbh_ch3_debug1)
+   mxs_reg_32(hw_apbh_ch3_debug2)
+   mxs_reg_32(hw_apbh_ch4_curcmdar)
+   mxs_reg_32(hw_apbh_ch4_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch4_cmd)
+   mxs_reg_32(hw_apbh_ch4_bar)
+   mxs_reg_32(hw_apbh_ch4_sema)
+   mxs_reg_32(hw_apbh_ch4_debug1)
+   mxs_reg_32(hw_apbh_ch4_debug2)
+   mxs_reg_32(hw_apbh_ch5_curcmdar)
+   mxs_reg_32(hw_apbh_ch5_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch5_cmd)
+   mxs_reg_32(hw_apbh_ch5_bar)
+   mxs_reg_32(hw_apbh_ch5_sema)
+   mxs_reg_32(hw_apbh_ch5_debug1)
+   mxs_reg_32(hw_apbh_ch5_debug2)
+   mxs_reg_32(hw_apbh_ch6_curcmdar)
+   mxs_reg_32(hw_apbh_ch6_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch6_cmd)
+   mxs_reg_32(hw_apbh_ch6_bar)
+   mxs_reg_32(hw_apbh_ch6_sema)
+   mxs_reg_32(hw_apbh_ch6_debug1)
+   mxs_reg_32(hw_apbh_ch6_debug2)
+   mxs_reg_32(hw_apbh_ch7_curcmdar)
+   mxs_reg_32(hw_apbh_ch7_nxtcmdar)
+   mxs_reg_32(hw_apbh_ch7_cmd)
+   mxs_reg_32(hw_apbh_ch7_bar)
+   mxs_reg_32(hw_apbh_ch7_sema)
+   mxs_reg_32(hw_apbh_ch7_debug1)
+   mxs_reg_32(hw_apbh_ch7_debug2)
+   };
+   };
+   mxs_reg_32(hw_apbh_version)
+};
+
+#elif defined(CONFIG_MX28)
 struct mxs_apbh_regs {
mxs_reg_32(hw_apbh_ctrl0)
mxs_reg_32(hw_apbh_ctrl1)
@@ -169,10 +250,26 @@ struct mxs_apbh_regs {
 };
 #endif
 
+#endif
+
 #defineAPBH_CTRL0_SFTRST   (1  31)
 #defineAPBH_CTRL0_CLKGATE  (1  30)
 #defineAPBH_CTRL0_AHB_BURST8_EN(1  29)
 #defineAPBH_CTRL0_APB_BURST_EN (1  28)
+#if defined(CONFIG_MX23)
+#defineAPBH_CTRL0_RSVD0_MASK   (0xf  24)
+#defineAPBH_CTRL0_RSVD0_OFFSET 24
+#defineAPBH_CTRL0_RESET_CHANNEL_MASK   (0xff  16)
+#defineAPBH_CTRL0_RESET_CHANNEL_OFFSET 16
+#defineAPBH_CTRL0_CLKGATE_CHANNEL_MASK (0xff  8)
+#define

  1   2   >