Re: [U-Boot] [PATCH] fastboot: Add USB cable detect check

2015-01-29 Thread Lukasz Majewski
Hi Rob,

> Add a check for USB cable attached and only enter fastboot when a
> cable is attached.
> 
> Signed-off-by: Rob Herring 
> ---
>  common/cmd_fastboot.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
> index b72f4f3..346ab80 100644
> --- a/common/cmd_fastboot.c
> +++ b/common/cmd_fastboot.c
> @@ -20,6 +20,12 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag,
> int argc, char *const argv[]) if (ret)
>   return ret;
>  
> + if (!g_dnl_board_usb_cable_connected()) {
> + puts("\rUSB cable not detected.\n" \
> +  "Command exit.\n");
> + return CMD_RET_FAILURE;
> + }
> +
>   while (1) {
>   if (g_dnl_detach())
>   break;

Reviewed-by: Lukasz Majewski 

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] fastboot: add "fastboot oem" command support

2015-01-29 Thread Lukasz Majewski
Hi Rob,

> From: Michael Scott 
> 
> Add code stub to handle "fastboot oem __" command. As unlock is a
> common fastboot command, distinguish that it is not implemented.
> 
> Signed-off-by: Michael Scott 
> Signed-off-by: Rob Herring 
> ---
>  drivers/usb/gadget/f_fastboot.c | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_fastboot.c
> b/drivers/usb/gadget/f_fastboot.c index 310175a..e2fda86 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -513,6 +513,17 @@ static void cb_flash(struct usb_ep *ep, struct
> usb_request *req) }
>  #endif
>  
> +static void cb_oem(struct usb_ep *ep, struct usb_request *req)
> +{
> + char *cmd = req->buf;
> + if (strncmp("unlock", cmd + 4, 8) == 0) {
> + fastboot_tx_write_str("FAILnot implemented");
> + }
> + else {
> + fastboot_tx_write_str("FAILunknown oem command");
> + }

Just a minor comment - those braces could be removed.

BTW: Marek shall I take those patches to dfu tree or would you take
them to -usb tree ?

> +}
> +
>  struct cmd_dispatch_info {
>   char *cmd;
>   void (*cb)(struct usb_ep *ep, struct usb_request *req);
> @@ -541,6 +552,10 @@ static const struct cmd_dispatch_info
> cmd_dispatch_info[] = { .cb = cb_flash,
>   },
>  #endif
> + {
> + .cmd = "oem",
> + .cb = cb_oem,
> + },
>  };
>  
>  static void rx_handler_command(struct usb_ep *ep, struct usb_request
> *req)



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] fastboot: add support for "oem format" command

2015-01-29 Thread Lukasz Majewski
Hi Rob,

> Add "oem format" command to write partition table. This relies on the
> env variable partitions to contain the list of partitions as required
> by the gpt command.
> 
> Note that this does not erase any data other than the partition table.
> 
> Signed-off-by: Rob Herring 
> ---
>  drivers/usb/gadget/f_fastboot.c | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_fastboot.c
> b/drivers/usb/gadget/f_fastboot.c index e2fda86..f7d84bf 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -516,6 +516,17 @@ static void cb_flash(struct usb_ep *ep, struct
> usb_request *req) static void cb_oem(struct usb_ep *ep, struct
> usb_request *req) {
>   char *cmd = req->buf;
> +#ifdef CONFIG_FASTBOOT_FLASH
> + if (strncmp("format", cmd + 4, 6) == 0) {
> + char cmdbuf[32];
> +sprintf(cmdbuf, "gpt write mmc %x $partitions",
> + CONFIG_FASTBOOT_FLASH_MMC_DEV);
> +if (run_command(cmdbuf, 0))
> + fastboot_tx_write_str("FAIL");
> +else
> + fastboot_tx_write_str("OKAY");
> + } else
> +#endif
>   if (strncmp("unlock", cmd + 4, 8) == 0) {
>   fastboot_tx_write_str("FAILnot implemented");
>   }

Reviewed-by: Lukasz Majewski 

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lcd: fix console address is not initialized

2015-01-29 Thread Anatolij Gustschin
Hi,

On Wed, 28 Jan 2015 09:13:22 +0800
Bo Shen  wrote:

> This commit 904672e (lcd: refactor lcd console stuff into its
> own file), which cause lcd console address is not initialized.
> 
> This patch initialize the lcd console use the default value,
> will be update when splash screen is enabled.
> 
> Signed-off-by: Bo Shen 
> ---
> Hi Tom,
>   If no objection of this patch, can you apply it as soon as possible. 
> Or else most Atmel SoC based boards (which enable lcd info) will be
> broken.
>   Thanks.
> 
>  common/lcd.c | 1 +
>  1 file changed, 1 insertion(+)

Slightly modified the commit log and applied to u-boot-video/master.

Thanks!

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


Re: [U-Boot] [PATCH] lcd: fix console address is not initialized

2015-01-29 Thread Bo Shen

Hi Anatolij,

On 01/29/2015 04:51 PM, Anatolij Gustschin wrote:

Hi,

On Wed, 28 Jan 2015 09:13:22 +0800
Bo Shen  wrote:


This commit 904672e (lcd: refactor lcd console stuff into its
own file), which cause lcd console address is not initialized.

This patch initialize the lcd console use the default value,
will be update when splash screen is enabled.

Signed-off-by: Bo Shen 
---
Hi Tom,
   If no objection of this patch, can you apply it as soon as possible.
Or else most Atmel SoC based boards (which enable lcd info) will be
broken.
   Thanks.

  common/lcd.c | 1 +
  1 file changed, 1 insertion(+)


Slightly modified the commit log and applied to u-boot-video/master.


Thanks.


Thanks!

Anatolij



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


Re: [U-Boot] Problem Mounting/Unmounting several UBI volumes in u-boot.

2015-01-29 Thread Heiko Schocher

Hello Konstantyn,

Am 21.01.2015 15:57, schrieb Konstantyn Prokopenko:

Hello Heiko,

I'll try the patch today.  Thank you very much!


Did you found time for trying it? I want to prepare a pull-request
for ubi, and it would be nice to have fixed your problem too ;-)

bye,
Heiko


Regards,
Konstantyn

-Original Message-
From: Heiko Schocher [mailto:h...@denx.de]
Sent: Wednesday, January 21, 2015 12:57 AM
To: Konstantyn Prokopenko
Cc: u-boot@lists.denx.de
Subject: Re: [U-Boot] Problem Mounting/Unmounting several UBI volumes in u-boot.

Hello Konstantyn,

Am 20.01.2015 17:09, schrieb Konstantyn Prokopenko:

Hello,

I'm using the latest u-boot on our custom board. The u-boot is located on the 
NAND flash in the first 4MB partition. I break 256MB NAND into 4 MTD 
partitions: u-boot(4MB), kernel(4MB), rootfs(100MB), safefs(40MB), varfs(108MB).
We are using Freescale iMX6 processor (nitrogen6x BSP in u-boot). I've modified 
board support code to include our pad configurations and additional hardware.
Also I added misc driver for our system initialization. The driver would mount 
rootfs UBI fs on rootfs MTD partition and validate system. If failed, it would 
unmounts it and mount UBI fs on safefs MTD partition and load it.
The problem was with unmounting rootfs and initializing safefs partition. Here 
is the relevant portion of my initialization script:
  "echo Loading just in case, default kernel from installation 
partition...;" \
  "nand read 1080 40 40;" \
  "echo Configuring NAND flash for MTD...;" \
  "mtdparts default; mtdparts;" \
  "echo Mounting Root filesystem;" \
  "ubi part rootfs;" \
  "ubifsmount ubi0:rootfs;" \
  "echo Verifying if filesystem and kernel is OK...;" \
  "parallax validate 1 kernel;" \
  "if test ${parallax_result} = 0; then " \
  "echo Reading kernel file from rootfs;" \
  "else " \
  "echo ROOTFS or Rootfs Kernel appears to be BAD. Trying 
SAFEFS...;" \
  "ubifsumount;" \
  "ubi part safefs;" \
  "ubifsmount ubi0:safefs;" \
  "parallax validate 2 kernel;" \
  "if test ${parallax_result} = 0; then " \
  "echo Reading kernel file from safefs;" \
  "else " \
  "echo All FILESYSTEMS are bad, booting from MTD1 kernel 
partition;" \
  "nand read 1080 40 40; bootm 1080;" \
  "fi;" \
  "fi;" \
  "ubifsload 1080 kernel;" \
  "ubifsumount;" \
  "bootm 1080;\0 " \

The parallax module is our own driver which is relevant to our system 
operations. It tests for validity currently mounted partition. Nothing fancy, 
just a bunch of MD5 checks.
OK, I've digged into the MTD/UBI code and found the problem. When mounting the 
first partition, no matter which one, the mtd_dev_param[] array is populated 
with the MTD device parameters entry (the first mounted partition). The 
ubi_init() finds it first and successfully attaches it.
When unmounting this partition, the mtd_dev_param[] array still includes the 
same entry and when attempting to mount the second partition, the array 
includes two mtd_dev_param enties: The first one for already unmounted MTD 
partition and the second for the next candidate.
The ubi_init start accessing this array from ID0 and after trying to attach 
entry 0 errors out ignoring the second entry.
I've added a temporary hack to avoid this problem. Because UBIFS can mount only 
a signgle partition at a time, I've introduced a global parameter:
Char *device_to_attach[] which is populated when ubi_mtd_param_parse() is 
called.
Now, in ubi_init() I check if the current entry to the mtd_dev_array matches 
the device to attach. Also I added check for NULL if we are out of devices.
...
  /* Attach MTD devices */
  for (i = 0; i < mtd_devs; i++) {
  struct mtd_dev_param *p = &mtd_dev_param[i];
  struct mtd_info *mtd;

  if(p == NULL) {
  printk(KERN_INFO "UBI_INIT: Could not find device: %s\n", 
device_to_attach);
  err = -ENODEV;
  goto out_slab;
  }
  if(strcmp(p->name, device_to_attach) != 0)
  continue;

This is a temp hack, just to make it work for our needs. Please advice if there 
are better ways or maybe we can just clean the mtd_dev_param array after 
unmounts being called.


Can you try this patch?

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

bye,
Heiko



--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Mun

[U-Boot] Pull request: u-boot-video/master

2015-01-29 Thread Anatolij Gustschin
Hey Tom,

The following changes since commit ab92da9f47d51d363c7de42e2a7bd807e2c1bd54:

  Merge branch 'master' of git://git.denx.de/u-boot-x86 (2015-01-26 17:44:49 
-0500)

are available in the git repository at:


  git://git.denx.de/u-boot-video.git master

for you to fetch changes up to 717e3a74fa71fac9b60e70c5c6a0decc11e54b10:

  lcd: fix console address is not initialized (2015-01-29 09:29:30 +0100)


Bo Shen (1):
  lcd: fix console address is not initialized

 common/lcd.c |1 +
 1 file changed, 1 insertion(+)

Please pull. Thanks!

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


[U-Boot] [RFC PATCH v2 1/6] x86: Add header files for Intel Quark SoC defines

2015-01-29 Thread Bin Meng
device.h for integrated pci devices' bdf on Quark SoC and quark.h for
various memory-mapped and i/o-mapped base addresses within SoC.

Signed-off-by: Bin Meng 

---

Changes in v2:
- Move vairous components' base addresses within Quark SoC to Kconfig

 arch/x86/include/asm/arch-quark/device.h | 28 
 arch/x86/include/asm/arch-quark/quark.h  | 27 +++
 2 files changed, 55 insertions(+)
 create mode 100644 arch/x86/include/asm/arch-quark/device.h
 create mode 100644 arch/x86/include/asm/arch-quark/quark.h

diff --git a/arch/x86/include/asm/arch-quark/device.h 
b/arch/x86/include/asm/arch-quark/device.h
new file mode 100644
index 000..4af3ded
--- /dev/null
+++ b/arch/x86/include/asm/arch-quark/device.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _QUARK_DEVICE_H_
+#define _QUARK_DEVICE_H_
+
+#include 
+
+#define QUARK_HOST_BRIDGE  PCI_BDF(0, 0, 0)
+#define QUARK_MMC_SDIO PCI_BDF(0, 20, 0)
+#define QUARK_UART0PCI_BDF(0, 20, 1)
+#define QUARK_USB_DEVICE   PCI_BDF(0, 20, 2)
+#define QUARK_USB_EHCI PCI_BDF(0, 20, 3)
+#define QUARK_USB_OHCI PCI_BDF(0, 20, 4)
+#define QUARK_UART1PCI_BDF(0, 20, 5)
+#define QUARK_EMAC0PCI_BDF(0, 20, 6)
+#define QUARK_EMAC1PCI_BDF(0, 20, 7)
+#define QUARK_SPI0 PCI_BDF(0, 21, 0)
+#define QUARK_SPI1 PCI_BDF(0, 21, 1)
+#define QUARK_I2C_GPIO PCI_BDF(0, 21, 2)
+#define QUARK_PCIE0PCI_BDF(0, 23, 0)
+#define QUARK_PCIE1PCI_BDF(0, 23, 1)
+#define QUARK_LEGACY_BRIDGEPCI_BDF(0, 31, 0)
+
+#endif /* _QUARK_DEVICE_H_ */
diff --git a/arch/x86/include/asm/arch-quark/quark.h 
b/arch/x86/include/asm/arch-quark/quark.h
new file mode 100644
index 000..7d603e1
--- /dev/null
+++ b/arch/x86/include/asm/arch-quark/quark.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _QUARK_H_
+#define _QUARK_H_
+
+/* DRAM */
+#define DRAM_BASE  0x
+#define DRAM_MAX_SIZE  0x8000
+
+/* eSRAM */
+#define ESRAM_SIZE 0x8
+#define ESRAM_BLOCK_MODE   0x1000
+
+/* Memory BAR Enable */
+#define MEM_BAR_EN 0x0001
+
+/* I/O BAR Enable */
+#define IO_BAR_EN  0x8000
+
+/* 64KiB of RMU binary in flash */
+#define RMU_BINARY_SIZE0x1
+
+#endif /* _QUARK_H_ */
-- 
1.8.2.1

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


[U-Boot] [RFC PATCH v2 3/6] x86: quark: Add Cache-As-RAM initialization

2015-01-29 Thread Bin Meng
Quark SoC contains an embedded 512KiB SRAM (eSRAM) that is
initialized by hardware. eSRAM is the ideal place to be used
for Cache-As-RAM (CAR) before system memory is available.

Signed-off-by: Bin Meng 

---

Changes in v2:
- Replace upper case register names (EAX etc.) with lower case
- Use some macros from  and 

 arch/x86/cpu/quark/car.S | 104 +++
 1 file changed, 104 insertions(+)
 create mode 100644 arch/x86/cpu/quark/car.S

diff --git a/arch/x86/cpu/quark/car.S b/arch/x86/cpu/quark/car.S
new file mode 100644
index 000..f32f9b1
--- /dev/null
+++ b/arch/x86/cpu/quark/car.S
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+.globl car_init
+car_init:
+   post_code(POST_CAR_START)
+
+   /*
+* Quark SoC contains an embedded 512KiB SRAM (eSRAM) that is
+* initialized by hardware. eSRAM is the ideal place to be used
+* for Cache-As-RAM (CAR) before system memory is available.
+*
+* Relocate this eSRAM to a suitable location in the physical
+* memory map and enable it.
+*/
+
+   /* Host Memory Bound Register P03h:R08h */
+   mov $((0x03 << 16) | (0x08 << 8)), %eax
+   mov $(DRAM_BASE + DRAM_MAX_SIZE + ESRAM_SIZE), %edx
+   lea 1f, %esp
+   jmp msg_port_write
+1:
+
+   /* eSRAM Block Page Control Register P05h:R82h */
+   mov $((0x05 << 16) | (0x82 << 8)), %eax
+   mov $(ESRAM_BLOCK_MODE | (CONFIG_ESRAM_BASE >> 24)), %edx
+   lea 2f, %esp
+   jmp msg_port_write
+2:
+
+   post_code(POST_CAR_CPU_CACHE)
+   jmp car_init_ret
+
+msg_port_read:
+   /*
+* Parameter:
+*   eax[23:16] - Message Port ID
+*   eax[15:08] - Register Address
+*
+* Return Value:
+*   eax - Message Port Register value
+*
+* Return Address: esp
+*/
+
+   or  $((MSG_OP_READ << 24) | MSG_BYTE_ENABLE), %eax
+   mov %eax, %ebx
+
+   /* Write MCR B0:D0:F0:RD0 */
+   mov $((1 << 31) | MSG_CTRL_REG), %eax
+   mov $0xcf8, %dx
+   out %eax, %dx
+   mov $0xcfc, %dx
+   mov %ebx, %eax
+   out %eax, %dx
+
+   /* Read MDR B0:D0:F0:RD4 */
+   mov $((1 << 31) | MSG_DATA_REG), %eax
+   mov $0xcf8, %dx
+   out %eax, %dx
+   mov $0xcfc, %dx
+   in  %dx, %eax
+
+   jmp *%esp
+
+msg_port_write:
+   /*
+* Parameter:
+*   eax[23:16] - Message Port ID
+*   eax[15:08] - Register Address
+*   edx- Message Port Register value to write
+*
+* Return Address: esp
+*/
+
+   or  $((MSG_OP_WRITE << 24) | MSG_BYTE_ENABLE), %eax
+   mov %eax, %esi
+   mov %edx, %edi
+
+   /* Write MDR B0:D0:F0:RD4 */
+   mov $((1 << 31) | MSG_DATA_REG), %eax
+   mov $0xcf8, %dx
+   out %eax, %dx
+   mov $0xcfc, %dx
+   mov %edi, %eax
+   out %eax, %dx
+
+   /* Write MCR B0:D0:F0:RD0 */
+   mov $((1 << 31) | MSG_CTRL_REG), %eax
+   mov $0xcf8, %dx
+   out %eax, %dx
+   mov $0xcfc, %dx
+   mov %esi, %eax
+   out %eax, %dx
+
+   jmp *%esp
-- 
1.8.2.1

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


[U-Boot] [RFC PATCH v2 2/6] x86: quark: Add routines to access message bus registers

2015-01-29 Thread Bin Meng
In the Quark SoC, some chipset commands are accomplished by utilizing
the internal message network within the host bridge (D0:F0). Accesses
to this network are accomplished by populating the message control
register (MCR), Message Control Register eXtension (MCRX) and the
message data register (MDR).

Signed-off-by: Bin Meng 

---

Changes in v2:
- Add msg_port_setup() and remove MCR_FILL
- Add MSG_BYTE_ENABLE define
- Wrap function declaraion with __ASSEMBLY__

 arch/x86/cpu/quark/msg_port.c  |  77 +
 arch/x86/include/asm/arch-quark/msg_port.h | 106 +
 2 files changed, 183 insertions(+)
 create mode 100644 arch/x86/cpu/quark/msg_port.c
 create mode 100644 arch/x86/include/asm/arch-quark/msg_port.h

diff --git a/arch/x86/cpu/quark/msg_port.c b/arch/x86/cpu/quark/msg_port.c
new file mode 100644
index 000..31713e3
--- /dev/null
+++ b/arch/x86/cpu/quark/msg_port.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+void msg_port_setup(int op, int port, int reg)
+{
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_REG,
+  (((op) << 24) | ((port) << 16) |
+  (((reg) << 8) & 0xff00) | MSG_BYTE_ENABLE));
+}
+
+u32 msg_port_read(u8 port, u32 reg)
+{
+   u32 value;
+
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_EXT_REG,
+  reg & 0xff00);
+   msg_port_setup(MSG_OP_READ, port, reg);
+   pci_read_config_dword(QUARK_HOST_BRIDGE, MSG_DATA_REG, &value);
+
+   return value;
+}
+
+void msg_port_write(u8 port, u32 reg, u32 value)
+{
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_DATA_REG, value);
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_EXT_REG,
+  reg & 0xff00);
+   msg_port_setup(MSG_OP_WRITE, port, reg);
+}
+
+u32 msg_port_alt_read(u8 port, u32 reg)
+{
+   u32 value;
+
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_EXT_REG,
+  reg & 0xff00);
+   msg_port_setup(MSG_OP_ALT_READ, port, reg);
+   pci_read_config_dword(QUARK_HOST_BRIDGE, MSG_DATA_REG, &value);
+
+   return value;
+}
+
+void msg_port_alt_write(u8 port, u32 reg, u32 value)
+{
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_DATA_REG, value);
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_EXT_REG,
+  reg & 0xff00);
+   msg_port_setup(MSG_OP_ALT_WRITE, port, reg);
+}
+
+u32 msg_port_io_read(u8 port, u32 reg)
+{
+   u32 value;
+
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_EXT_REG,
+  reg & 0xff00);
+   msg_port_setup(MSG_OP_IO_READ, port, reg);
+   pci_read_config_dword(QUARK_HOST_BRIDGE, MSG_DATA_REG, &value);
+
+   return value;
+}
+
+void msg_port_io_write(u8 port, u32 reg, u32 value)
+{
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_DATA_REG, value);
+   pci_write_config_dword(QUARK_HOST_BRIDGE, MSG_CTRL_EXT_REG,
+  reg & 0xff00);
+   msg_port_setup(MSG_OP_IO_WRITE, port, reg);
+}
diff --git a/arch/x86/include/asm/arch-quark/msg_port.h 
b/arch/x86/include/asm/arch-quark/msg_port.h
new file mode 100644
index 000..a241107
--- /dev/null
+++ b/arch/x86/include/asm/arch-quark/msg_port.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _QUARK_MSG_PORT_H_
+#define _QUARK_MSG_PORT_H_
+
+/*
+ * In the Quark SoC, some chipset commands are accomplished by utilizing
+ * the internal message network within the host bridge (D0:F0). Accesses
+ * to this network are accomplished by populating the message control
+ * register (MCR), Message Control Register eXtension (MCRX) and the
+ * message data register (MDR).
+ */
+#define MSG_CTRL_REG   0xD0/* Message Control Register */
+#define MSG_DATA_REG   0xD4/* Message Data Register */
+#define MSG_CTRL_EXT_REG   0xD8/* Message Control Register EXT */
+
+/* Normal Read/Write OpCodes */
+#define MSG_OP_READ0x10
+#define MSG_OP_WRITE   0x11
+
+/* Alternative Read/Write OpCodes */
+#define MSG_OP_ALT_READ0x06
+#define MSG_OP_ALT_WRITE   0x07
+
+/* IO Read/Write OpCodes */
+#define MSG_OP_IO_READ 0x02
+#define MSG_OP_IO_WRITE0x03
+
+/* All byte enables */
+#define MSG_BYTE_ENABLE0xF0
+
+#ifndef __ASSEMBLY__
+
+/**
+ * msg_port_setup - set up the message port control register
+ *
+ * @op: message bus access opcode
+ * @port:   port number on the message bus
+ * @reg:register number within a port
+ */
+void msg_port_setup(int op, int port, int reg);
+
+/**
+ * msg_port_read - read a message port register using normal opcode
+ *
+ * @port:   port number on the message bus
+ * @reg:  

[U-Boot] [RFC PATCH v2 4/6] x86: Add basic Intel Quark processor support

2015-01-29 Thread Bin Meng
Add minimum codes to support Intel Quark SoC. DRAM initialization
is not ready yet so a hardcoded gd->ram_size is assigned.

Signed-off-by: Bin Meng 

---

Changes in v2:
- Use machine-specific
- Move vairous components' base addresses within Quark SoC to Kconfig
- Rebase to u-boot-86/master

 arch/x86/cpu/quark/Kconfig | 118 +
 arch/x86/cpu/quark/Makefile|   8 +++
 arch/x86/cpu/quark/dram.c  |  39 +++
 arch/x86/cpu/quark/pci.c   |  70 +++
 arch/x86/cpu/quark/quark.c |  44 
 arch/x86/include/asm/arch-quark/gpio.h |  13 
 6 files changed, 292 insertions(+)
 create mode 100644 arch/x86/cpu/quark/Kconfig
 create mode 100644 arch/x86/cpu/quark/Makefile
 create mode 100644 arch/x86/cpu/quark/dram.c
 create mode 100644 arch/x86/cpu/quark/pci.c
 create mode 100644 arch/x86/cpu/quark/quark.c
 create mode 100644 arch/x86/include/asm/arch-quark/gpio.h

diff --git a/arch/x86/cpu/quark/Kconfig b/arch/x86/cpu/quark/Kconfig
new file mode 100644
index 000..8bccf09
--- /dev/null
+++ b/arch/x86/cpu/quark/Kconfig
@@ -0,0 +1,118 @@
+#
+# Copyright (C) 2015, Bin Meng 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+config INTEL_QUARK
+   bool
+   select HAVE_RMU
+
+if INTEL_QUARK
+
+config HAVE_RMU
+   bool "Add a Remote Management Unit (RMU) binary"
+   help
+ Select this option to add a Remote Management Unit (RMU) binary
+ to the resulting U-Boot image. It is a data block (up to 64K) of
+ machine-specific code which must be put in the flash for the RMU
+ within the Quark SoC processor to access when powered up before
+ system BIOS is executed.
+
+config RMU_FILE
+   string "Remote Management Unit (RMU) binary filename"
+   depends on HAVE_RMU
+   default "rmu.bin"
+   help
+ The filename of the file to use as Remote Management Unit (RMU)
+ binary in the board directory.
+
+config RMU_ADDR
+   hex "Remote Management Unit (RMU) binary location"
+   depends on HAVE_RMU
+   default 0xfff0
+   help
+ The location of the RMU binary is determined by a strap. It must be
+ put in flash at a location matching the strap-determined base address.
+
+ The default base address of 0xfff0 indicates that the binary must
+ be located at offset 0 from the beginning of a 1MB flash device.
+
+config HAVE_CMC
+   bool
+   default HAVE_RMU
+
+config CMC_FILE
+   string
+   depends on HAVE_CMC
+   default RMU_FILE
+
+config CMC_ADDR
+   hex
+   depends on HAVE_CMC
+   default RMU_ADDR
+
+config ESRAM_BASE
+   hex
+   default 0x8000
+   help
+ Embedded SRAM (eSRAM) memory-mapped base address.
+
+config PCIE_ECAM_BASE
+   hex
+   default 0xe000
+
+config RCBA_BASE
+   hex
+   default 0xfed1c000
+   help
+ Root Complex register block memory-mapped base address.
+
+config ACPI_PM1_BASE
+   hex
+   default 0x1000
+   help
+ ACPI PM1 i/o-mapped base address.
+
+config ACPI_P_BASE
+   hex
+   default 0x1010
+   help
+ ACPI PBLK i/o-mapped base address.
+
+config SPI_DMA_BASE
+   hex
+   default 0x1020
+   help
+ SPI DMA i/o-mapped base address.
+
+config GPIO_BASE
+   hex
+   default 0x1080
+   help
+ GPIO i/o-mapped base address.
+
+config GPE0_BASE
+   hex
+   default 0x1100
+   help
+ GPE0 i/o-mapped base address.
+
+config WDT_BASE
+   hex
+   default 0x1140
+   help
+ Watchdog timer i/o-mapped base address.
+
+config SYS_CAR_ADDR
+   hex
+   default ESRAM_BASE
+
+config SYS_CAR_SIZE
+   hex
+   default 0x8000
+   help
+ Space in bytes in eSRAM used as Cache-As-ARM (CAR).
+ Note this size must not exceed eSRAM's total size.
+
+endif
diff --git a/arch/x86/cpu/quark/Makefile b/arch/x86/cpu/quark/Makefile
new file mode 100644
index 000..168c1e6
--- /dev/null
+++ b/arch/x86/cpu/quark/Makefile
@@ -0,0 +1,8 @@
+#
+# Copyright (C) 2015, Bin Meng 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += car.o dram.o msg_port.o quark.o
+obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/x86/cpu/quark/dram.c b/arch/x86/cpu/quark/dram.c
new file mode 100644
index 000..fbdc3cd
--- /dev/null
+++ b/arch/x86/cpu/quark/dram.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+   /* hardcode the DRAM size for now */
+   gd->ram_size = DRAM_MAX_SIZE;
+   post_code(POST_DRAM);
+
+   return 0;
+}
+
+void dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = 0;
+   gd->bd->bi_dram[0].size = gd->ram_size;
+}
+
+/*
+ * This function looks for the highest region of memory lower than 4

[U-Boot] [RFC PATCH v2 0/6] x86: New Intel Quark SoC support

2015-01-29 Thread Bin Meng
This series adds the first step of bare support for the Intel Quark
SoC support which can be validated on Intel Galileo board.

Intel Quark is a line of 32-bit x86 SoCs by Intel, designed for small
size and low power consumption, and targeted at new markets including
wearable devices. They are smaller and slower than Atom processors and
consume less power. They lack support for SIMD instruction sets (such
as MMX and SSE) and only support embedded operating systems. Quark
powers the Intel Galileo developer microcontroller board. The CPU
instruction set is the same as Pentium (P54C/i586) CPU.

Intel decided to completely publish Quark's hardware specification to
software developers, which includes an SoC datasheet, a UEFI Firmware
Writer's Guide, and a complete reference source code for the UEFI BIOS
which is pre-flahsed on the Galileo board. As of today, the only BIOS
for Galileo is the Intel one with UEFI inteface only. There is no CSM
support yet in that BIOS, neither any 3rd party BIOS vendor provides
support to Quark SoC.

Only one binary blob (exactly 8KiB) is needed which is rmu.bin for
Remote Management Unit. Not like FSP, U-Boot will not call into the
binary. The binary is needed by the Quark SoC itself.

Note there are two generation of Galileo boards, aka gen1 and gen2.
Currently the development work is on gen2, but once we get it boot,
we can easily add the gen1 board (old version).

With this patch series, the generated u-boot.rom could boot the Intel
Galileo board up to fdt relocate, where U-Boot hangs because the DRAM
is not initializaed yet. A follow up patch series will be sent soon
to add support for Memory Reference Code (MRC).

Changes in v2:
- Rebase to u-boot-86/master
- Move vairous components' base addresses within Quark SoC to Kconfig
- Add msg_port_setup() and remove MCR_FILL
- Add MSG_BYTE_ENABLE define
- Wrap function declaraion with __ASSEMBLY__
- Replace upper case register names (EAX etc.) with lower case
- Use some macros from  and 
- Use machine-specific
- Use Arduino-certified

Bin Meng (6):
  x86: Add header files for Intel Quark SoC defines
  x86: quark: Add routines to access message bus registers
  x86: quark: Add Cache-As-RAM initialization
  x86: Add basic Intel Quark processor support
  x86: Add basic Intel Galileo board support
  x86: Enable the Intel quark/galileo build

 arch/x86/Kconfig   |  17 +
 arch/x86/cpu/Makefile  |   1 +
 arch/x86/cpu/quark/Kconfig | 118 +
 arch/x86/cpu/quark/Makefile|   8 ++
 arch/x86/cpu/quark/car.S   | 104 +
 arch/x86/cpu/quark/dram.c  |  39 ++
 arch/x86/cpu/quark/msg_port.c  |  77 +++
 arch/x86/cpu/quark/pci.c   |  70 +
 arch/x86/cpu/quark/quark.c |  44 +++
 arch/x86/dts/Makefile  |   1 +
 arch/x86/dts/galileo.dts   |  43 +++
 arch/x86/include/asm/arch-quark/device.h   |  28 +++
 arch/x86/include/asm/arch-quark/gpio.h |  13 
 arch/x86/include/asm/arch-quark/msg_port.h | 106 ++
 arch/x86/include/asm/arch-quark/quark.h|  27 +++
 board/intel/galileo/Kconfig|  21 +
 board/intel/galileo/MAINTAINERS|   6 ++
 board/intel/galileo/Makefile   |   7 ++
 board/intel/galileo/galileo.c  |  19 +
 board/intel/galileo/start.S|   9 +++
 configs/galileo_defconfig  |   6 ++
 include/configs/galileo.h  |  53 +
 22 files changed, 817 insertions(+)
 create mode 100644 arch/x86/cpu/quark/Kconfig
 create mode 100644 arch/x86/cpu/quark/Makefile
 create mode 100644 arch/x86/cpu/quark/car.S
 create mode 100644 arch/x86/cpu/quark/dram.c
 create mode 100644 arch/x86/cpu/quark/msg_port.c
 create mode 100644 arch/x86/cpu/quark/pci.c
 create mode 100644 arch/x86/cpu/quark/quark.c
 create mode 100644 arch/x86/dts/galileo.dts
 create mode 100644 arch/x86/include/asm/arch-quark/device.h
 create mode 100644 arch/x86/include/asm/arch-quark/gpio.h
 create mode 100644 arch/x86/include/asm/arch-quark/msg_port.h
 create mode 100644 arch/x86/include/asm/arch-quark/quark.h
 create mode 100644 board/intel/galileo/Kconfig
 create mode 100644 board/intel/galileo/MAINTAINERS
 create mode 100644 board/intel/galileo/Makefile
 create mode 100644 board/intel/galileo/galileo.c
 create mode 100644 board/intel/galileo/start.S
 create mode 100644 configs/galileo_defconfig
 create mode 100644 include/configs/galileo.h

-- 
1.8.2.1

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


[U-Boot] [RFC PATCH v2 6/6] x86: Enable the Intel quark/galileo build

2015-01-29 Thread Bin Meng
Make the Intel quark/galileo support avaiable in Kconfig and Makefile.
With this patch, we can generate u-boot.rom for Intel galileo board.

Signed-off-by: Bin Meng 
Reviewed-by: Simon Glass 

---

Changes in v2:
- Use Arduino-certified

 arch/x86/Kconfig  | 17 +
 arch/x86/cpu/Makefile |  1 +
 2 files changed, 18 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index defdce7..85dda2e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -52,6 +52,19 @@ config TARGET_MINNOWMAX
  Note that PCIE_ECAM_BASE is set up by the FSP so the value used
  by U-Boot matches that value.
 
+config TARGET_GALILEO
+   bool "Support Intel Galileo"
+   help
+ This is the Intel Galileo board, which is the first in a family of
+ Arduino-certified development and prototyping boards based on Intel
+ architecture. It includes an Intel Quark SoC X1000 processor, a 32-bit
+ single-core, single-thread, Intel Pentium processor instrunction set
+ architecture (ISA) compatible, operating at speeds up to 400Mhz,
+ along with 256MB DDR3 memory. It supports a wide range of industry
+ standard I/O interfaces, including a full-sized mini-PCIe slot,
+ one 100Mb Ethernet port, a microSD card slot, a USB host port and
+ a USB client port.
+
 endchoice
 
 config RAMBASE
@@ -399,6 +412,8 @@ source "arch/x86/cpu/coreboot/Kconfig"
 
 source "arch/x86/cpu/ivybridge/Kconfig"
 
+source "arch/x86/cpu/quark/Kconfig"
+
 source "arch/x86/cpu/queensbay/Kconfig"
 
 source "board/coreboot/coreboot/Kconfig"
@@ -409,6 +424,8 @@ source "board/intel/crownbay/Kconfig"
 
 source "board/intel/minnowmax/Kconfig"
 
+source "board/intel/galileo/Kconfig"
+
 config PCIE_ECAM_BASE
hex
 default 0xe000
diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
index 5acf8bb..6ded0a7 100644
--- a/arch/x86/cpu/Makefile
+++ b/arch/x86/cpu/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/
 obj-$(CONFIG_SYS_COREBOOT) += coreboot/
 obj-$(CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE) += ivybridge/
 obj-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += ivybridge/
+obj-$(CONFIG_INTEL_QUARK) += quark/
 obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/
 obj-y += lapic.o
 obj-y += mtrr.o
-- 
1.8.2.1

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


[U-Boot] [RFC PATCH v2 5/6] x86: Add basic Intel Galileo board support

2015-01-29 Thread Bin Meng
New board/intel/galileo board directory with minimum codes, plus
board dts, defconfig and configuration files.

Signed-off-by: Bin Meng 
Reviewed-by: Simon Glass 
---

Changes in v2: None

 arch/x86/dts/Makefile   |  1 +
 arch/x86/dts/galileo.dts| 43 +
 board/intel/galileo/Kconfig | 21 
 board/intel/galileo/MAINTAINERS |  6 +
 board/intel/galileo/Makefile|  7 ++
 board/intel/galileo/galileo.c   | 19 +++
 board/intel/galileo/start.S |  9 +++
 configs/galileo_defconfig   |  6 +
 include/configs/galileo.h   | 53 +
 9 files changed, 165 insertions(+)
 create mode 100644 arch/x86/dts/galileo.dts
 create mode 100644 board/intel/galileo/Kconfig
 create mode 100644 board/intel/galileo/MAINTAINERS
 create mode 100644 board/intel/galileo/Makefile
 create mode 100644 board/intel/galileo/galileo.c
 create mode 100644 board/intel/galileo/start.S
 create mode 100644 configs/galileo_defconfig
 create mode 100644 include/configs/galileo.h

diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
index 4e0171a..7a66133 100644
--- a/arch/x86/dts/Makefile
+++ b/arch/x86/dts/Makefile
@@ -1,5 +1,6 @@
 dtb-y += chromebook_link.dtb \
crownbay.dtb \
+   galileo.dtb \
minnowmax.dtb
 
 targets += $(dtb-y)
diff --git a/arch/x86/dts/galileo.dts b/arch/x86/dts/galileo.dts
new file mode 100644
index 000..14a19c3
--- /dev/null
+++ b/arch/x86/dts/galileo.dts
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+   model = "Intel Galileo";
+   compatible = "intel,galileo", "intel,quark";
+
+   config {
+   silent_console = <0>;
+   };
+
+   chosen {
+   stdout-path = &pciuart0;
+   };
+
+   pci {
+   #address-cells = <3>;
+   #size-cells = <2>;
+   compatible = "intel,pci";
+   device_type = "pci";
+
+   pciuart0: uart@14,5 {
+   compatible = "pci8086,0936.00",
+   "pci8086,0936",
+   "pciclass,070002",
+   "pciclass,0700",
+   "x86-uart";
+   reg = <0xa500 0x0 0x0 0x0 0x0
+  0x0200a510 0x0 0x0 0x0 0x0>;
+   reg-shift = <2>;
+   clock-frequency = <44236800>;
+   current-speed = <115200>;
+   };
+   };
+
+};
diff --git a/board/intel/galileo/Kconfig b/board/intel/galileo/Kconfig
new file mode 100644
index 000..85afbbc
--- /dev/null
+++ b/board/intel/galileo/Kconfig
@@ -0,0 +1,21 @@
+if TARGET_GALILEO
+
+config SYS_BOARD
+   default "galileo"
+
+config SYS_VENDOR
+   default "intel"
+
+config SYS_SOC
+   default "quark"
+
+config SYS_CONFIG_NAME
+   default "galileo"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+   def_bool y
+   select X86_RESET_VECTOR
+   select INTEL_QUARK
+   select BOARD_ROMSIZE_KB_1024
+
+endif
diff --git a/board/intel/galileo/MAINTAINERS b/board/intel/galileo/MAINTAINERS
new file mode 100644
index 000..dbbc82e
--- /dev/null
+++ b/board/intel/galileo/MAINTAINERS
@@ -0,0 +1,6 @@
+INTEL GALILEO BOARD
+M: Bin Meng 
+S: Maintained
+F: board/intel/galileo/
+F: include/configs/galileo.h
+F: configs/galileo_defconfig
diff --git a/board/intel/galileo/Makefile b/board/intel/galileo/Makefile
new file mode 100644
index 000..8356df1
--- /dev/null
+++ b/board/intel/galileo/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2015, Bin Meng 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  += galileo.o start.o
diff --git a/board/intel/galileo/galileo.c b/board/intel/galileo/galileo.c
new file mode 100644
index 000..f2e7468
--- /dev/null
+++ b/board/intel/galileo/galileo.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+   return 0;
+}
+
+void setup_pch_gpios(u16 gpiobase, const struct pch_gpio_map *gpio)
+{
+   return;
+}
diff --git a/board/intel/galileo/start.S b/board/intel/galileo/start.S
new file mode 100644
index 000..a71db69
--- /dev/null
+++ b/board/intel/galileo/start.S
@@ -0,0 +1,9 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+.globl early_board_init
+early_board_init:
+   jmp early_board_init_ret
diff --git a/configs/galileo_defconfig b/configs/galileo_defconfig
new file mode 100644
index 000..f208651
--- /dev/null
+++ b/configs/galileo_defconfig
@@ -0,0 +1,6 @@
+CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xfff1"
+CONFIG_X86=y
+CONFIG_TARGET_GALILEO=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_SEPA

[U-Boot] [PATCH] ARM: armv7 fix spelling of SCTRL

2015-01-29 Thread Peng Fan
SCTLR is the abbreviation of System Control Register, so we should
use SCTLR but not SCTRL.

Signed-off-by: Peng Fan 
---
 arch/arm/cpu/armv7/cpu.c   | 2 +-
 arch/arm/cpu/armv7/start.S | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index 01cdb7e..c56417d 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -53,7 +53,7 @@ int cleanup_before_linux(void)
 * After D-cache is flushed and before it is disabled there may
 * be some new valid entries brought into the cache. We are sure
 * that these lines are not dirty and will not affect our execution.
-* (because unwinding the call-stack and setting a bit in CP15 SCTRL
+* (because unwinding the call-stack and setting a bit in CP15 SCTLR
 * is all we did during this. We have not pushed anything on to the
 * stack. Neither have we affected any static data)
 * So just invalidate the entire d-cache again to avoid coherency
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index fdc05b9..70048c1 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -52,10 +52,10 @@ reset:
  * Continue to use ROM code vector only in OMAP4 spl)
  */
 #if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD))
-   /* Set V=0 in CP15 SCTRL register - for VBAR to point to vector */
-   mrc p15, 0, r0, c1, c0, 0   @ Read CP15 SCTRL Register
+   /* Set V=0 in CP15 SCTLR register - for VBAR to point to vector */
+   mrc p15, 0, r0, c1, c0, 0   @ Read CP15 SCTLR Register
bic r0, #CR_V   @ V = 0
-   mcr p15, 0, r0, c1, c0, 0   @ Write CP15 SCTRL Register
+   mcr p15, 0, r0, c1, c0, 0   @ Write CP15 SCTLR Register
 
/* Set vector address in CP15 VBAR register */
ldr r0, =_start
-- 
1.8.4


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


[U-Boot] [PATCH 1/4] MIPS: use asm.h macros in mips32 start.S

2015-01-29 Thread Paul Burton
Where the mips32 & mips64 implementations of start.S differ in terms of
access sizes & offsets, use the appropriate macros from asm.h to
abstract those differences away. This is in preparation for sharing a
single copy of start.S between mips32 & mips64.

The exception to this is loads of immediates to be written to the cop0
Config register, which is a 32bit register on mips64 and therefore
constants written to it can be loaded as such.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 arch/mips/cpu/mips32/start.S | 116 +++
 1 file changed, 61 insertions(+), 55 deletions(-)

diff --git a/arch/mips/cpu/mips32/start.S b/arch/mips/cpu/mips32/start.S
index 36b92cc..227af6d 100644
--- a/arch/mips/cpu/mips32/start.S
+++ b/arch/mips/cpu/mips32/start.S
@@ -8,6 +8,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -98,8 +99,8 @@ _start:
 reset:
 
/* Clear watch registers */
-   mtc0zero, CP0_WATCHLO
-   mtc0zero, CP0_WATCHHI
+   MTC0zero, CP0_WATCHLO
+   MTC0zero, CP0_WATCHHI
 
/* WP(Watch Pending), SW0/1 should be cleared */
mtc0zero, CP0_CAUSE
@@ -116,21 +117,26 @@ reset:
mtc0t0, CP0_CONFIG
 #endif
 
-   /* Initialize $gp */
+   /*
+* Initialize $gp, force pointer sized alignment of bal instruction to
+* forbid the compiler to put nop's between bal and _gp. This is
+* required to keep _gp and ra aligned to 8 byte.
+*/
+   .align  PTRLOG
bal 1f
 nop
-   .word   _gp
+   PTR _gp
 1:
-   lw  gp, 0(ra)
+   PTR_L   gp, 0(ra)
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
/* Initialize any external memory */
-   la  t9, lowlevel_init
+   PTR_LA  t9, lowlevel_init
jalrt9
 nop
 
/* Initialize caches... */
-   la  t9, mips_cache_reset
+   PTR_LA  t9, mips_cache_reset
jalrt9
 nop
 
@@ -140,15 +146,15 @@ reset:
 #endif
 
/* Set up temporary stack */
-   li  t0, -16
-   li  t1, CONFIG_SYS_INIT_SP_ADDR
+   PTR_LI  t0, -16
+   PTR_LI  t1, CONFIG_SYS_INIT_SP_ADDR
and sp, t1, t0  # force 16 byte alignment
-   sub sp, sp, GD_SIZE # reserve space for gd
+   PTR_SUB sp, sp, GD_SIZE # reserve space for gd
and sp, sp, t0  # force 16 byte alignment
movek0, sp  # save gd pointer
 #ifdef CONFIG_SYS_MALLOC_F_LEN
-   li  t2, CONFIG_SYS_MALLOC_F_LEN
-   sub sp, sp, t2  # reserve space for early malloc
+   PTR_LI  t2, CONFIG_SYS_MALLOC_F_LEN
+   PTR_SUB sp, sp, t2  # reserve space for early malloc
and sp, sp, t0  # force 16 byte alignment
 #endif
movefp, sp
@@ -158,14 +164,14 @@ reset:
 1:
sw  zero, 0(t0)
blt t0, t1, 1b
-addi   t0, 4
+PTR_ADDI t0, 4
 
 #ifdef CONFIG_SYS_MALLOC_F_LEN
-   addut0, k0, GD_MALLOC_BASE  # gd->malloc_base offset
+   PTR_ADDU t0, k0, GD_MALLOC_BASE # gd->malloc_base offset
sw  sp, 0(t0)
 #endif
 
-   la  t9, board_init_f
+   PTR_LA  t9, board_init_f
jr  t9
 move   ra, zero
 
@@ -188,14 +194,14 @@ relocate_code:
moves0, a1  # save gd in s0
moves2, a2  # save destination address in s2
 
-   li  t0, CONFIG_SYS_MONITOR_BASE
-   sub s1, s2, t0  # s1 <-- relocation offset
+   PTR_LI  t0, CONFIG_SYS_MONITOR_BASE
+   PTR_SUB s1, s2, t0  # s1 <-- relocation offset
 
-   la  t3, in_ram
-   lw  t2, -12(t3) # t2 <-- __image_copy_end
+   PTR_LA  t3, in_ram
+   PTR_L   t2, -(3 * PTRSIZE)(t3)  # t2 <-- __image_copy_end
movet1, a2
 
-   add gp, s1  # adjust gp
+   PTR_ADD gp, s1  # adjust gp
 
/*
 * t0 = source address
@@ -205,26 +211,26 @@ relocate_code:
 1:
lw  t3, 0(t0)
sw  t3, 0(t1)
-   addut0, 4
+   PTR_ADDU t0, 4
blt t0, t2, 1b
-addu   t1, 4
+PTR_ADDU t1, 4
 
/* If caches were enabled, we would have to flush them here. */
-   sub a1, t1, s2  # a1 <-- size
-   la  t9, flush_cache
+   PTR_SUB a1, t1, s2  # a1 <-- size
+   PTR_LA  t9, flush_cache
jalrt9
 move   a0, s2  # a0 <-- destination address
 
/* Jump to where we've relocated ourselves */
-   addit0, s2, in_ram - _start
+   PTR_ADDI t0, s2, in_ram - _start
jr  t0
 nop
 
-   .word   __rel_dyn_end
-   .word   __rel_dyn_start
-   .word   __image_copy_end
-   .word   _GLOBAL_OFFSET_TABLE_
-   .word   num_got_entries
+   PTR __rel_dyn_end
+   PTR  

[U-Boot] [PATCH 2/4] MIPS: handle mips64 relocs in mips32 start.S

2015-01-29 Thread Paul Burton
In preparation for sharing a single copy of start.S between mips32 &
mips64, handle mips64 relocations in the mips32 start.S when built for
mips64.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 arch/mips/cpu/mips32/start.S | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/mips/cpu/mips32/start.S b/arch/mips/cpu/mips32/start.S
index 227af6d..699c59a 100644
--- a/arch/mips/cpu/mips32/start.S
+++ b/arch/mips/cpu/mips32/start.S
@@ -21,6 +21,21 @@
CONFIG_SYS_INIT_SP_OFFSET)
 #endif
 
+#ifdef CONFIG_32BIT
+# define MIPS_RELOC3
+#endif
+
+#ifdef CONFIG_64BIT
+# ifdef CONFIG_SYS_LITTLE_ENDIAN
+#  define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
+   (((r_type) << 24) | ((r_type2) << 16) | ((r_type3) << 8) | (ssym))
+# else
+#  define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
+   ((r_type) | ((r_type2) << 8) | ((r_type3) << 16) | (ssym) << 24)
+# endif
+# define MIPS_RELOCMIPS64_R_INFO(0x00, 0x00, 0x12, 0x03)
+#endif
+
/*
 * For the moment disable interrupts, mark the kernel mode and
 * set ST0_KX so that the CPU does not spit fire when using
@@ -264,8 +279,8 @@ in_ram:
 1:
lw  t8, -4(t1)  # t8 <-- relocation info
 
-   PTR_LI  t3, 3
-   bne t8, t3, 2f  # skip non R_MIPS_REL32 entries
+   PTR_LI  t3, MIPS_RELOC
+   bne t8, t3, 2f  # skip non-MIPS_RELOC entries
 nop
 
PTR_L   t3, -(2 * PTRSIZE)(t1)  # t3 <-- location to fix up in FLASH
-- 
2.2.2

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


[U-Boot] [PATCH 3/4] MIPS: handle mips64 ST0_KX bit in mips32 start.S

2015-01-29 Thread Paul Burton
In preparation for sharing a single copy of start.S between mips32 &
mips64, handle setting the KX bit of the cop0 Status register when the
mips32 start.S is built for mips64.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 arch/mips/cpu/mips32/start.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/cpu/mips32/start.S b/arch/mips/cpu/mips32/start.S
index 699c59a..3b5b622 100644
--- a/arch/mips/cpu/mips32/start.S
+++ b/arch/mips/cpu/mips32/start.S
@@ -23,6 +23,7 @@
 
 #ifdef CONFIG_32BIT
 # define MIPS_RELOC3
+# define STATUS_SET0
 #endif
 
 #ifdef CONFIG_64BIT
@@ -34,6 +35,7 @@
((r_type) | ((r_type2) << 8) | ((r_type3) << 16) | (ssym) << 24)
 # endif
 # define MIPS_RELOCMIPS64_R_INFO(0x00, 0x00, 0x12, 0x03)
+# define STATUS_SETST0_KX
 #endif
 
/*
@@ -120,7 +122,7 @@ reset:
/* WP(Watch Pending), SW0/1 should be cleared */
mtc0zero, CP0_CAUSE
 
-   setup_c0_status 0 0
+   setup_c0_status STATUS_SET 0
 
/* Init Timer */
mtc0zero, CP0_COUNT
-- 
2.2.2

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


[U-Boot] [PATCH 0/4] MIPS: unify start.S

2015-01-29 Thread Paul Burton
Currently we have mips32-specific & mips64-specific versions of start.S,
which are very similar. This short series adapts the mips32 start.S to
also be suitable for mips64 systems & then shares that single copy
between mips32 & mips64 builds.

Paul Burton (4):
  MIPS: use asm.h macros in mips32 start.S
  MIPS: handle mips64 relocs in mips32 start.S
  MIPS: handle mips64 ST0_KX bit in mips32 start.S
  MIPS: share start.S between mips32 & mips64

 arch/mips/Makefile|   3 +-
 arch/mips/cpu/mips32/Makefile |   1 -
 arch/mips/cpu/mips64/Makefile |   1 -
 arch/mips/cpu/mips64/start.S  | 291 --
 arch/mips/lib/Makefile|   2 +
 arch/mips/{cpu/mips32 => lib}/start.S | 137 +---
 6 files changed, 83 insertions(+), 352 deletions(-)
 delete mode 100644 arch/mips/cpu/mips64/start.S
 rename arch/mips/{cpu/mips32 => lib}/start.S (61%)

-- 
2.2.2

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


[U-Boot] [PATCH 4/4] MIPS: share start.S between mips32 & mips64

2015-01-29 Thread Paul Burton
The mips32 copy of start.S now has everything required to also handle
mips64 builds. Move it to arch/mips/lib, use it for all builds & remove
the redundant mips64-specific version.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 arch/mips/Makefile|   3 +-
 arch/mips/cpu/mips32/Makefile |   1 -
 arch/mips/cpu/mips64/Makefile |   1 -
 arch/mips/cpu/mips64/start.S  | 291 --
 arch/mips/lib/Makefile|   2 +
 arch/mips/{cpu/mips32 => lib}/start.S |   0
 6 files changed, 3 insertions(+), 295 deletions(-)
 delete mode 100644 arch/mips/cpu/mips64/start.S
 rename arch/mips/{cpu/mips32 => lib}/start.S (100%)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 0a9e7e6..5a66979 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -2,8 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-head-$(CONFIG_CPU_MIPS32) := arch/mips/cpu/mips32/start.o
-head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o
+head-y := arch/mips/lib/start.o
 
 libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/
 libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/
diff --git a/arch/mips/cpu/mips32/Makefile b/arch/mips/cpu/mips32/Makefile
index 19d316a..9973cd3 100644
--- a/arch/mips/cpu/mips32/Makefile
+++ b/arch/mips/cpu/mips32/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-extra-y= start.o
 obj-y  = cpu.o interrupts.o time.o
 
 obj-$(CONFIG_SOC_AU1X00) += au1x00/
diff --git a/arch/mips/cpu/mips64/Makefile b/arch/mips/cpu/mips64/Makefile
index cb4db9c..33fda36 100644
--- a/arch/mips/cpu/mips64/Makefile
+++ b/arch/mips/cpu/mips64/Makefile
@@ -5,5 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-extra-y= start.o
 obj-y  = cpu.o interrupts.o time.o
diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
deleted file mode 100644
index 471bc1e..000
--- a/arch/mips/cpu/mips64/start.S
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- *  Startup Code for MIPS64 CPU-core
- *
- *  Copyright (c) 2003 Wolfgang Denk 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-#ifndef CONFIG_SYS_MIPS_CACHE_MODE
-#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
-#endif
-
-#ifndef CONFIG_SYS_INIT_SP_ADDR
-#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + \
-   CONFIG_SYS_INIT_SP_OFFSET)
-#endif
-
-#ifdef CONFIG_SYS_LITTLE_ENDIAN
-#define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
-   (((r_type) << 24) | ((r_type2) << 16) | ((r_type3) << 8) | (ssym))
-#else
-#define MIPS64_R_INFO(ssym, r_type3, r_type2, r_type) \
-   ((r_type) | ((r_type2) << 8) | ((r_type3) << 16) | (ssym) << 24)
-#endif
-
-   /*
-* For the moment disable interrupts, mark the kernel mode and
-* set ST0_KX so that the CPU does not spit fire when using
-* 64-bit addresses.
-*/
-   .macro  setup_c0_status set clr
-   .setpush
-   mfc0t0, CP0_STATUS
-   or  t0, ST0_CU0 | \set | 0x1f | \clr
-   xor t0, 0x1f | \clr
-   mtc0t0, CP0_STATUS
-   .setnoreorder
-   sll zero, 3 # ehb
-   .setpop
-   .endm
-
-   .set noreorder
-
-   .globl _start
-   .text
-_start:
-   /* U-boot entry point */
-   b   reset
-nop
-
-   .org 0x200
-   /* TLB refill, 32 bit task */
-1: b   1b
-nop
-
-   .org 0x280
-   /* XTLB refill, 64 bit task */
-1: b   1b
-nop
-
-   .org 0x300
-   /* Cache error exception */
-1: b   1b
-nop
-
-   .org 0x380
-   /* General exception */
-1: b   1b
-nop
-
-   .org 0x400
-   /* Catch interrupt exceptions */
-1: b   1b
-nop
-
-   .org 0x480
-   /* EJTAG debug exception */
-1: b   1b
-nop
-
-   .align 4
-reset:
-
-   /* Clear watch registers */
-   dmtc0   zero, CP0_WATCHLO
-   dmtc0   zero, CP0_WATCHHI
-
-   /* WP(Watch Pending), SW0/1 should be cleared */
-   mtc0zero, CP0_CAUSE
-
-   setup_c0_status ST0_KX 0
-
-   /* Init Timer */
-   mtc0zero, CP0_COUNT
-   mtc0zero, CP0_COMPARE
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-   /* CONFIG0 register */
-   dli t0, CONF_CM_UNCACHED
-   mtc0t0, CP0_CONFIG
-#endif
-
-   /*
-* Initialize $gp, force 8 byte alignment of bal instruction to forbid
-* the compiler to put nop's between bal and _gp. This is required to
-* keep _gp and ra aligned to 8 byte.
-*/
-   .align  3
-   bal 1f
-nop
-   .dword  _gp
-1:
-   ld  gp, 0(ra)
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-   /* Initialize any external memory */
-   dla t9, lowlevel_init
-   jalrt9
-nop
-
-   /* Initialize caches... */
-   dla t9, mips_cache_reset
-

[U-Boot] [PATCH 0/4] malta: IDE support, reset fix, config updates

2015-01-29 Thread Paul Burton
This series includes a few assorted improvements to the MIPS Malta board
support.

Paul Burton (4):
  malta: IDE support
  malta: delay after reset
  malta: enable HUSH parser
  malta: enable ELF loading

 arch/mips/include/asm/malta.h |  5 +
 board/imgtec/malta/malta.c| 20 
 include/configs/malta.h   | 13 +
 3 files changed, 38 insertions(+)

-- 
2.2.2

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


[U-Boot] [PATCH 1/4] malta: IDE support

2015-01-29 Thread Paul Burton
This patch adds IDE support to the MIPS Malta board. The IDE controller
is enabled after probing the PCI bus and otherwise just makes use of
U-boot generic IDE support.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 arch/mips/include/asm/malta.h |  5 +
 board/imgtec/malta/malta.c| 19 +++
 include/configs/malta.h   | 11 +++
 3 files changed, 35 insertions(+)

diff --git a/arch/mips/include/asm/malta.h b/arch/mips/include/asm/malta.h
index 9e7c045..d9ffc15 100644
--- a/arch/mips/include/asm/malta.h
+++ b/arch/mips/include/asm/malta.h
@@ -64,4 +64,9 @@
 
 #define PCI_CFG_PIIX4_GENCFG_SERIRQ(1 << 16)
 
+#define PCI_CFG_PIIX4_IDETIM_PRI   0x40
+#define PCI_CFG_PIIX4_IDETIM_SEC   0x42
+
+#define PCI_CFG_PIIX4_IDETIM_IDE   (1 << 15)
+
 #endif /* _MIPS_ASM_MALTA_H */
diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c
index 78c4bd4..72b03ff 100644
--- a/board/imgtec/malta/malta.c
+++ b/board/imgtec/malta/malta.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -217,4 +218,22 @@ void pci_init_board(void)
pci_read_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, &val8);
val8 |= PCI_CFG_PIIX4_SERIRQC_EN | PCI_CFG_PIIX4_SERIRQC_CONT;
pci_write_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, val8);
+
+   bdf = pci_find_device(PCI_VENDOR_ID_INTEL,
+ PCI_DEVICE_ID_INTEL_82371AB, 0);
+   if (bdf == -1)
+   panic("Failed to find PIIX4 IDE controller\n");
+
+   /* enable bus master & IO access */
+   val32 |= PCI_COMMAND_MASTER | PCI_COMMAND_IO;
+   pci_write_config_dword(bdf, PCI_COMMAND, val32);
+
+   /* set latency */
+   pci_write_config_byte(bdf, PCI_LATENCY_TIMER, 0x40);
+
+   /* enable IDE/ATA */
+   pci_write_config_dword(bdf, PCI_CFG_PIIX4_IDETIM_PRI,
+  PCI_CFG_PIIX4_IDETIM_IDE);
+   pci_write_config_dword(bdf, PCI_CFG_PIIX4_IDETIM_SEC,
+  PCI_CFG_PIIX4_IDETIM_IDE);
 }
diff --git a/include/configs/malta.h b/include/configs/malta.h
index 684d249..ed5da6c 100644
--- a/include/configs/malta.h
+++ b/include/configs/malta.h
@@ -107,6 +107,16 @@
(CONFIG_SYS_FLASH_BASE + (4 << 20) - CONFIG_ENV_SIZE)
 
 /*
+ * IDE/ATA
+ */
+#define CONFIG_SYS_IDE_MAXBUS  1
+#define CONFIG_SYS_IDE_MAXDEVICE   2
+#define CONFIG_SYS_ATA_BASE_ADDR   CONFIG_SYS_ISA_IO_BASE_ADDRESS
+#define CONFIG_SYS_ATA_IDE0_OFFSET 0x01f0
+#define CONFIG_SYS_ATA_DATA_OFFSET 0
+#define CONFIG_SYS_ATA_REG_OFFSET  0
+
+/*
  * Commands
  */
 #include 
@@ -118,6 +128,7 @@
 
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_IDE
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
 
-- 
2.2.2

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


[U-Boot] [PATCH 3/4] malta: enable HUSH parser

2015-01-29 Thread Paul Burton
The malta board is used for development and thus the shell is interacted
with often. Enable HUSH to make the experience a little more pleasant.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 include/configs/malta.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/malta.h b/include/configs/malta.h
index ed5da6c..4e64cc9 100644
--- a/include/configs/malta.h
+++ b/include/configs/malta.h
@@ -71,6 +71,7 @@
 sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16
 
+#define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_CMDLINE_EDITING
 
-- 
2.2.2

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


[U-Boot] [PATCH 2/4] malta: delay after reset

2015-01-29 Thread Paul Burton
Reset isn't instant, so delay to give it a chance. Otherwise we go on
to print a failure message before resetting anyway.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 board/imgtec/malta/malta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c
index 72b03ff..79562f7 100644
--- a/board/imgtec/malta/malta.c
+++ b/board/imgtec/malta/malta.c
@@ -124,6 +124,7 @@ void _machine_restart(void)
 
reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE);
__raw_writel(GORESET, reset_base);
+   mdelay(1000);
 }
 
 int board_early_init_f(void)
-- 
2.2.2

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


[U-Boot] [PATCH 4/4] malta: enable ELF loading

2015-01-29 Thread Paul Burton
The ability to load ELF files is sometimes useful on Malta boards,
particularly for use with small embedded applications. Enable the
loadelf command in the malta config.

Signed-off-by: Paul Burton 
Cc: Daniel Schwierzeck 
---
 include/configs/malta.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/malta.h b/include/configs/malta.h
index 4e64cc9..354672e 100644
--- a/include/configs/malta.h
+++ b/include/configs/malta.h
@@ -129,6 +129,7 @@
 
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
-- 
2.2.2

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


[U-Boot] [PATCH 00/13] common lcd refactor

2015-01-29 Thread Nikita Kiryanov
This series is part of my ongoing efforts to cleanup common/lcd code (and at
some point merge it with the CONFIG_VIDEO code).
This series focuses on eliminating platform specific #defines from lcd.c code,
and then adds a few platform independent code refactors and cleanups on top of
that. A few notes on the series:

- The patch "lcd: split splash code into its own function" depends on Bo Shen's
patch "lcd: fix console address is not initialized"
(https://patchwork.ozlabs.org/patch/433746/).

- The patch "lcd: split configuration_get_cmap" turned out to be a little
problematic: the goal was to move all platform specific code to the appropriate
lcd/fb drivers, and keep the generic case in lcd.c as a weak function.
This was not possible to do for configuration_get_cmap(), because the weak
version still has to compile even if it is overridden, and unfortunately the
generic case references panel_info, which is a struct that varies depending on
the configuration, and does not always have a cmap field. This demonstrated that
the visibility of panel_info should be reviewed, and that there might be a need
for some kind of lcd_generic driver.
Since this may warrant a series of its own, I opted to tentatively implement
the generic configuration_get_cmap() function in lcd.h as static inline, and
plan to revisit it in the next series.

The end result was compile tested on arm and powerpc, and tested on cm_t35
(splash screen feature).

Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 

Nikita Kiryanov (13):
  lcd: move platform specific structs to their own headers
  lcd: split configuration_get_cmap
  lcd: atmel: move atmel specific fb_put_word to atmel_lcdfb
  lcd: mpc8xx: move mpc823 specific fb_put_byte to mpc8xx_lcd.c
  lcd: atmel: introduce lcd_logo_set_cmap
  lcd: mpc823: move mpc823 specific lcd_logo_set_cmap code to
mpc8xx_lcd.c
  lcd: logo: move generic cmap setting to lcd_logo_set_cmap()
  lcd: introduce lcd_set_cmap
  lcd: remove unused includes
  lcd: various cleanups
  lcd: rename bitmap_plot to better represent its functionality
  lcd: dt: extract simplefb support
  lcd: split splash code into its own function

 board/raspberrypi/rpi/rpi.c  |   1 +
 common/Makefile  |   1 +
 common/lcd.c | 358 ++-
 common/lcd_simplefb.c|  59 +++
 common/splash.c  |  16 ++
 drivers/video/atmel_hlcdfb.c |  13 ++
 drivers/video/atmel_lcdfb.c  |  51 ++
 drivers/video/exynos_fb.c|   9 ++
 drivers/video/mpc8xx_lcd.c   |  29 
 drivers/video/pxa_lcd.c  |   6 +
 include/atmel_lcd.h  |  38 +
 include/exynos_lcd.h |  81 ++
 include/fdt_simplefb.h   |  14 ++
 include/lcd.h| 313 ++---
 include/mpc823_lcd.h |  43 ++
 include/pxa_lcd.h|  80 ++
 include/splash.h |  11 +-
 17 files changed, 576 insertions(+), 547 deletions(-)
 create mode 100644 common/lcd_simplefb.c
 create mode 100644 include/atmel_lcd.h
 create mode 100644 include/exynos_lcd.h
 create mode 100644 include/fdt_simplefb.h
 create mode 100644 include/mpc823_lcd.h
 create mode 100644 include/pxa_lcd.h

-- 
1.9.1

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


[U-Boot] [PATCH 12/13] lcd: dt: extract simplefb support

2015-01-29 Thread Nikita Kiryanov
We now have api functions that can support compiling simplefb code as its own
module. Since this code is not part of the display functionality, extract it
to its own file.

Raspberry Pi config file is updated to compile the new file.

Signed-off-by: Nikita Kiryanov 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
Cc: Stephen Warren 
---
 board/raspberrypi/rpi/rpi.c |  1 +
 common/Makefile |  1 +
 common/lcd.c| 50 --
 common/lcd_simplefb.c   | 59 +
 include/fdt_simplefb.h  | 14 +++
 include/lcd.h   |  3 ---
 6 files changed, 75 insertions(+), 53 deletions(-)
 create mode 100644 common/lcd_simplefb.c
 create mode 100644 include/fdt_simplefb.h

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index c18271f..948078b 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/common/Makefile b/common/Makefile
index 94554f2..24df0f7 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -197,6 +197,7 @@ obj-$(CONFIG_I2C_EDID) += edid.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-y += splash.o
 obj-$(CONFIG_LCD) += lcd.o lcd_console.o
+obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
 obj-$(CONFIG_MODEM_SUPPORT) += modem.o
diff --git a/common/lcd.c b/common/lcd.c
index 2dce45c..d0c0aff 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -20,13 +20,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
-#if defined(CONFIG_LCD_DT_SIMPLEFB)
-#include 
-#endif
-
 #ifdef CONFIG_LCD_LOGO
 #include 
 #include 
@@ -777,48 +772,3 @@ int lcd_get_pixel_height(void)
 {
return panel_info.vl_row;
 }
-
-#if defined(CONFIG_LCD_DT_SIMPLEFB)
-static int lcd_dt_simplefb_configure_node(void *blob, int off)
-{
-#if LCD_BPP == LCD_COLOR16
-   return fdt_setup_simplefb_node(blob, off, gd->fb_base,
-  panel_info.vl_col, panel_info.vl_row,
-  panel_info.vl_col * 2, "r5g6b5");
-#else
-   return -1;
-#endif
-}
-
-int lcd_dt_simplefb_add_node(void *blob)
-{
-   static const char compat[] = "simple-framebuffer";
-   static const char disabled[] = "disabled";
-   int off, ret;
-
-   off = fdt_add_subnode(blob, 0, "framebuffer");
-   if (off < 0)
-   return -1;
-
-   ret = fdt_setprop(blob, off, "status", disabled, sizeof(disabled));
-   if (ret < 0)
-   return -1;
-
-   ret = fdt_setprop(blob, off, "compatible", compat, sizeof(compat));
-   if (ret < 0)
-   return -1;
-
-   return lcd_dt_simplefb_configure_node(blob, off);
-}
-
-int lcd_dt_simplefb_enable_existing_node(void *blob)
-{
-   int off;
-
-   off = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
-   if (off < 0)
-   return -1;
-
-   return lcd_dt_simplefb_configure_node(blob, off);
-}
-#endif
diff --git a/common/lcd_simplefb.c b/common/lcd_simplefb.c
new file mode 100644
index 000..8db2add
--- /dev/null
+++ b/common/lcd_simplefb.c
@@ -0,0 +1,59 @@
+/*
+ * Simplefb device tree support
+ *
+ * (C) Copyright 2015
+ * Stephen Warren 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int lcd_dt_simplefb_configure_node(void *blob, int off)
+{
+#if LCD_BPP == LCD_COLOR16
+   int vl_col = lcd_get_pixel_width();
+   int vl_row = lcd_get_pixel_height();
+   return fdt_setup_simplefb_node(blob, off, gd->fb_base, vl_col, vl_row,
+  vl_col * 2, "r5g6b5");
+#else
+   return -1;
+#endif
+}
+
+int lcd_dt_simplefb_add_node(void *blob)
+{
+   static const char compat[] = "simple-framebuffer";
+   static const char disabled[] = "disabled";
+   int off, ret;
+
+   off = fdt_add_subnode(blob, 0, "framebuffer");
+   if (off < 0)
+   return -1;
+
+   ret = fdt_setprop(blob, off, "status", disabled, sizeof(disabled));
+   if (ret < 0)
+   return -1;
+
+   ret = fdt_setprop(blob, off, "compatible", compat, sizeof(compat));
+   if (ret < 0)
+   return -1;
+
+   return lcd_dt_simplefb_configure_node(blob, off);
+}
+
+int lcd_dt_simplefb_enable_existing_node(void *blob)
+{
+   int off;
+
+   off = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
+   if (off < 0)
+   return -1;
+
+   return lcd_dt_simplefb_configure_node(blob, off);
+}
diff --git a/include/fdt_simplefb.h b/include/fdt_simplefb.h
new file mode 100644
index 000..8c89a19
--- /dev/null
+++ b/include/fdt_simplefb.h
@@ -0,0 +1,14 @@
+/*
+ * Simplefb device tree support
+ *
+ * (C) Copyright 2015
+ * Stephen Warren 
+ *
+ * SPDX-License-Identifier:GPL-2.

[U-Boot] [PATCH 02/13] lcd: split configuration_get_cmap

2015-01-29 Thread Nikita Kiryanov
configuration_get_cmap() is multiple platform specific functions stuffed into
one function. Split it into multiple versions, and move each version to the
appropriate driver to reduce the #ifdef complexity.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c | 19 ---
 drivers/video/atmel_hlcdfb.c | 13 +
 drivers/video/atmel_lcdfb.c  |  5 +
 drivers/video/exynos_fb.c|  9 +
 drivers/video/mpc8xx_lcd.c   |  7 +++
 drivers/video/pxa_lcd.c  |  6 ++
 include/lcd.h|  9 +
 7 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 1195a54..0f6c2e4 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -383,25 +383,6 @@ int lcd_getbgcolor(void)
 //
 /* ** Chipset depending Bitmap / Logo stuff...  */
 //
-static inline ushort *configuration_get_cmap(void)
-{
-#if defined CONFIG_CPU_PXA
-   struct pxafb_info *fbi = &panel_info.pxa;
-   return (ushort *)fbi->palette;
-#elif defined(CONFIG_MPC823)
-   immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-   cpm8xx_t *cp = &(immr->im_cpm);
-   return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
-#elif defined(CONFIG_ATMEL_LCD)
-   return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
-#elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB)
-   return panel_info.cmap;
-#elif defined(CONFIG_LCD_LOGO)
-   return bmp_logo_palette;
-#else
-   return NULL;
-#endif
-}
 
 #ifdef CONFIG_LCD_LOGO
 void bitmap_plot(int x, int y)
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index 935ae42..0ce2370 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -13,6 +13,10 @@
 #include 
 #include 
 
+#if defined(CONFIG_LCD_LOGO)
+#include 
+#endif
+
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT0xc8
 #define ATMEL_LCDC_DMA_BURST_LEN   8
@@ -37,6 +41,15 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, 
ushort blue)
panel_info.mmio + ATMEL_LCDC_LUT(regno));
 }
 
+ushort *configuration_get_cmap(void)
+{
+#if defined(CONFIG_LCD_LOGO)
+   return bmp_logo_palette;
+#else
+   return NULL;
+#endif
+}
+
 void lcd_ctrl_init(void *lcdbase)
 {
unsigned long value;
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 3cf008c..fa6a82c 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -29,6 +29,11 @@
 #define lcdc_readl(mmio, reg)  __raw_readl((mmio)+(reg))
 #define lcdc_writel(mmio, reg, val)__raw_writel((val), (mmio)+(reg))
 
+ushort *configuration_get_cmap(void)
+{
+   return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
+}
+
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
 {
 #if defined(CONFIG_ATMEL_LCD_BGR555)
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index be35b98..c5d7330 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -37,6 +37,15 @@ vidinfo_t panel_info  = {
 };
 #endif
 
+ushort *configuration_get_cmap(void)
+{
+#if defined(CONFIG_LCD_LOGO)
+   return bmp_logo_palette;
+#else
+   return NULL;
+#endif
+}
+
 static void exynos_lcd_init_mem(void *lcdbase, vidinfo_t *vid)
 {
unsigned long palette_size;
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index add7215..9d2e5ed 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -357,6 +357,13 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, 
ushort blue)
 
 /*--*/
 
+ushort *configuration_get_cmap(void)
+{
+   immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+   cpm8xx_t *cp = &(immr->im_cpm);
+   return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
+}
+
 void lcd_enable (void)
 {
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
index f66f615..04105d4 100644
--- a/drivers/video/pxa_lcd.c
+++ b/drivers/video/pxa_lcd.c
@@ -342,6 +342,12 @@ static int pxafb_init (vidinfo_t *vid);
 /* ---  PXA chipset specific functions  --- */
 //
 
+ushort *configuration_get_cmap(void)
+{
+   struct pxafb_info *fbi = &panel_info.pxa;
+   return (ushort *)fbi->palette;
+}
+
 void lcd_ctrl_init (void *lcdbase)
 {
pxafb_init_mem(lcdbase, &panel_info);
diff --git a/include/lcd.h b/include/lcd.h
index fbba6a2..838f645 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -42,13 +42,17 @@ void lcd_set_flush_dcache(int flush);
 
 #if defined CONFIG_MPC823
 #include 
+ushort *configuration_g

[U-Boot] [PATCH 04/13] lcd: mpc8xx: move mpc823 specific fb_put_byte to mpc8xx_lcd.c

2015-01-29 Thread Nikita Kiryanov
Reduce the amount of platform dependant code in common/lcd.c by moving MPC823
specific implementation of fb_put_byte() to mpc8xx_lcd.c. Since we must also
have a default implementation for everybody else, make the remainder of the
code into a weak function.

Signed-off-by: Nikita Kiryanov 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c   | 11 +--
 drivers/video/mpc8xx_lcd.c |  7 +++
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index f17b35b..efd9a87 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -635,11 +635,10 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, 
ushort *cmap, uchar *fb,
 }
 #endif
 
-#if defined(CONFIG_MPC823)
-#define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
-#else
-#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
-#endif
+__weak void fb_put_byte(uchar **fb, uchar **from)
+{
+   *(*fb)++ = *(*from)++;
+}
 
 #if defined(CONFIG_BMP_16BPP)
 __weak void fb_put_word(uchar **fb, uchar **from)
@@ -764,7 +763,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
WATCHDOG_RESET();
for (j = 0; j < width; j++) {
if (bpix != 16) {
-   FB_PUT_BYTE(fb, bmap);
+   fb_put_byte(&fb, &bmap);
} else {
*(uint16_t *)fb = cmap_base[*(bmap++)];
fb += sizeof(uint16_t) / sizeof(*fb);
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 9d2e5ed..190c05a 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -364,6 +364,13 @@ ushort *configuration_get_cmap(void)
return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
 }
 
+#if defined(CONFIG_MPC823)
+void fb_put_byte(uchar **fb, uchar **from)
+{
+   *(*fb)++ = (255 - *(*from)++);
+}
+#endif
+
 void lcd_enable (void)
 {
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-- 
1.9.1

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


[U-Boot] [PATCH 13/13] lcd: split splash code into its own function

2015-01-29 Thread Nikita Kiryanov
lcd_logo() currently performs tasks well beyond just displaying the logo.
It has code which displays splash image, it has logic which determines
when the different display features are displayed, and it is coupled with
the lcd console because it holds the responsibility of returning the
lcd console base address.

Make lcd_logo() just about the logo by:
* Moving splash image display code into a dedicated function
* Moving the logic regarding when various features are displayed to
  lcd_clear() (which is arguably not the correct name for housing such
  code either, but it is currently the most fitting location code wise)
* Move the responsibility of setting the console base address to
  lcd_clear() too.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c | 52 ++--
 common/splash.c  | 16 
 include/splash.h | 11 ++-
 3 files changed, 48 insertions(+), 31 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index d0c0aff..f33942c 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -46,7 +46,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static int lcd_init(void *lcdbase);
-static void *lcd_logo(void);
+static void lcd_logo(void);
 static void lcd_setfgcolor(int color);
 static void lcd_setbgcolor(int color);
 
@@ -169,6 +169,9 @@ void lcd_clear(void)
 {
short console_rows, console_cols;
int bg_color;
+   char *s;
+   ulong addr;
+   static int do_splash = 1;
 #if LCD_BPP == LCD_COLOR8
/* Setting the palette */
lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
@@ -218,7 +221,23 @@ void lcd_clear(void)
 #endif
console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
lcd_init_console(lcd_base, console_rows, console_cols);
-   lcd_init_console(lcd_logo(), console_rows, console_cols);
+   if (do_splash) {
+   s = getenv("splashimage");
+   if (s) {
+   do_splash = 0;
+   addr = simple_strtoul(s, NULL, 16);
+   if (lcd_splash(addr) == 0) {
+   lcd_sync();
+   return;
+   }
+   }
+   }
+
+   lcd_logo();
+#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
+   addr = (ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length;
+   lcd_init_console((void *)addr, console_rows, console_cols);
+#endif
lcd_sync();
 }
 
@@ -701,29 +720,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
-static void *lcd_logo(void)
+static void lcd_logo(void)
 {
-#ifdef CONFIG_SPLASH_SCREEN
-   char *s;
-   ulong addr;
-   static int do_splash = 1;
-
-   if (do_splash && (s = getenv("splashimage")) != NULL) {
-   int x = 0, y = 0;
-   do_splash = 0;
-
-   if (splash_screen_prepare())
-   return (void *)lcd_base;
-
-   addr = simple_strtoul (s, NULL, 16);
-
-   splash_get_pos(&x, &y);
-
-   if (bmp_display(addr, x, y) == 0)
-   return (void *)lcd_base;
-   }
-#endif /* CONFIG_SPLASH_SCREEN */
-
lcd_logo_plot(0, 0);
 
 #ifdef CONFIG_LCD_INFO
@@ -731,12 +729,6 @@ static void *lcd_logo(void)
lcd_set_row(LCD_INFO_Y / VIDEO_FONT_HEIGHT);
lcd_show_board_info();
 #endif /* CONFIG_LCD_INFO */
-
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length);
-#else
-   return (void *)lcd_base;
-#endif /* CONFIG_LCD_LOGO && !defined(CONFIG_LCD_INFO_BELOW_LOGO) */
 }
 
 #ifdef CONFIG_SPLASHIMAGE_GUARD
diff --git a/common/splash.c b/common/splash.c
index 144fb10..561d35b 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 
 __weak int splash_screen_prepare(void)
 {
@@ -50,3 +51,18 @@ void splash_get_pos(int *x, int *y)
}
 }
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
+
+#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_LCD)
+int lcd_splash(ulong addr)
+{
+   int x = 0, y = 0, ret;
+
+   ret = splash_screen_prepare();
+   if (ret)
+   return ret;
+
+   splash_get_pos(&x, &y);
+
+   return bmp_display(addr, x, y);
+}
+#endif
diff --git a/include/splash.h b/include/splash.h
index 89ee7b2..4dbf754 100644
--- a/include/splash.h
+++ b/include/splash.h
@@ -21,7 +21,7 @@
 
 #ifndef _SPLASH_H_
 #define _SPLASH_H_
-
+#include 
 
 int splash_screen_prepare(void);
 
@@ -31,6 +31,15 @@ void splash_get_pos(int *x, int *y);
 static inline void splash_get_pos(int *x, int *y) { }
 #endif
 
+#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_LCD)
+int lcd_splash(ulong addr);
+#else
+static inline int lcd_splash(ulong addr)
+{
+   return -ENOSYS;
+}
+#endif
+
 #define BMP_ALIGN_CENTER   0x7FFF
 
 #endif
-- 
1.9.1

__

[U-Boot] [PATCH 09/13] lcd: remove unused includes

2015-01-29 Thread Nikita Kiryanov
Remove unused includes.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c | 18 --
 1 file changed, 18 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 8a8d6c3..7a51923 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -16,14 +16,9 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
-#if defined(CONFIG_POST)
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -32,19 +27,6 @@
 #include 
 #include 
 
-#if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
-   defined(CONFIG_CPU_MONAHANS)
-#include 
-#endif
-
-#if defined(CONFIG_MPC823)
-#include 
-#endif
-
-#if defined(CONFIG_ATMEL_LCD)
-#include 
-#endif
-
 #if defined(CONFIG_LCD_DT_SIMPLEFB)
 #include 
 #endif
-- 
1.9.1

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


[U-Boot] [PATCH 11/13] lcd: rename bitmap_plot to better represent its functionality

2015-01-29 Thread Nikita Kiryanov
The name "bitmap_plot" is misleading because it implies that this is a generic
function capable of dealing with any bitmap, but its implementation only works
with the logo data.

Rename the function to better reflect this.

Signed-off-by: Nikita Kiryanov 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 06eec45..2dce45c 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -327,7 +327,7 @@ __weak void lcd_logo_set_cmap(void)
*cmap++ = bmp_logo_palette[i];
 }
 
-void bitmap_plot(int x, int y)
+void lcd_logo_plot(int x, int y)
 {
ushort i, j;
uchar *bmap = &bmp_logo_bitmap[0];
@@ -369,7 +369,7 @@ void bitmap_plot(int x, int y)
lcd_sync();
 }
 #else
-static inline void bitmap_plot(int x, int y) {}
+static inline void lcd_logo_plot(int x, int y) {}
 #endif /* CONFIG_LCD_LOGO */
 
 #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
@@ -729,7 +729,7 @@ static void *lcd_logo(void)
}
 #endif /* CONFIG_SPLASH_SCREEN */
 
-   bitmap_plot(0, 0);
+   lcd_logo_plot(0, 0);
 
 #ifdef CONFIG_LCD_INFO
lcd_set_col(LCD_INFO_X / VIDEO_FONT_WIDTH);
-- 
1.9.1

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


[U-Boot] [PATCH 05/13] lcd: atmel: introduce lcd_logo_set_cmap

2015-01-29 Thread Nikita Kiryanov
Reduce the bitmap_plot #ifdef complexity by extracting Atmel specific code for
setting cmap into a new function lcd_logo_set_cmap(), which is implemented in
atmel_lcdfb driver and defined as part of common/lcd.c api with a weak dummy
version. In the Atmel implementation, ARRAY_SIZE(bmp_logo_palette) is
switched for BMP_LOGO_COLORS to avoid having to include bmp_logo_data.h, which
would cause a compilation error because the logo data and palette arrays would
be defined twice.

This is a step towards cleaning bitmap_plot() of platform specific code.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c| 29 -
 drivers/video/atmel_lcdfb.c | 26 ++
 2 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index efd9a87..7fcac1d 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -385,13 +385,13 @@ int lcd_getbgcolor(void)
 //
 
 #ifdef CONFIG_LCD_LOGO
+__weak void lcd_logo_set_cmap(void)
+{
+}
+
 void bitmap_plot(int x, int y)
 {
-#ifdef CONFIG_ATMEL_LCD
-   uint *cmap = (uint *)bmp_logo_palette;
-#else
ushort *cmap = (ushort *)bmp_logo_palette;
-#endif
ushort i, j;
uchar *bmap;
uchar *fb;
@@ -417,8 +417,6 @@ void bitmap_plot(int x, int y)
 */
 #if defined(CONFIG_MPC823)
cmap = (ushort *) &(cp->lcd_cmap[BMP_LOGO_OFFSET * 
sizeof(ushort)]);
-#elif defined(CONFIG_ATMEL_LCD)
-   cmap = (uint *)configuration_get_cmap();
 #else
cmap = configuration_get_cmap();
 #endif
@@ -426,25 +424,14 @@ void bitmap_plot(int x, int y)
WATCHDOG_RESET();
 
/* Set color map */
+#ifdef CONFIG_ATMEL_LCD
+   lcd_logo_set_cmap();
+#else
for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i) {
ushort colreg = bmp_logo_palette[i];
-#ifdef CONFIG_ATMEL_LCD
-   uint lut_entry;
-#ifdef CONFIG_ATMEL_LCD_BGR555
-   lut_entry = ((colreg & 0x000F) << 11) |
-   ((colreg & 0x00F0) <<  2) |
-   ((colreg & 0x0F00) >>  7);
-#else /* CONFIG_ATMEL_LCD_RGB565 */
-   lut_entry = ((colreg & 0x000F) << 1) |
-   ((colreg & 0x00F0) << 3) |
-   ((colreg & 0x0F00) << 4);
-#endif
-   *(cmap + BMP_LOGO_OFFSET) = lut_entry;
-   cmap++;
-#else /* !CONFIG_ATMEL_LCD */
*cmap++ = colreg;
-#endif /* CONFIG_ATMEL_LCD */
}
+#endif
 
WATCHDOG_RESET();
 
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index c7991cd..2a71eba 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -43,6 +43,32 @@ void fb_put_word(uchar **fb, uchar **from)
 }
 #endif
 
+#ifdef CONFIG_LCD_LOGO
+#include 
+void lcd_logo_set_cmap(void)
+{
+   int i;
+   uint lut_entry;
+   ushort colreg;
+   uint *cmap = (uint *)configuration_get_cmap();
+
+   for (i = 0; i < BMP_LOGO_COLORS; ++i) {
+   colreg = bmp_logo_palette[i];
+#ifdef CONFIG_ATMEL_LCD_BGR555
+   lut_entry = ((colreg & 0x000F) << 11) |
+   ((colreg & 0x00F0) <<  2) |
+   ((colreg & 0x0F00) >>  7);
+#else
+   lut_entry = ((colreg & 0x000F) << 1) |
+   ((colreg & 0x00F0) << 3) |
+   ((colreg & 0x0F00) << 4);
+#endif
+   *(cmap + BMP_LOGO_OFFSET) = lut_entry;
+   cmap++;
+   }
+}
+#endif
+
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
 {
 #if defined(CONFIG_ATMEL_LCD_BGR555)
-- 
1.9.1

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


[U-Boot] [PATCH 01/13] lcd: move platform specific structs to their own headers

2015-01-29 Thread Nikita Kiryanov
common/lcd code is full of platform specific code and definitions, which
ideally should reside with the respective driver code. Take a step towards that
goal by moving platform specific structs from lcd.h to their own header files.

The structs for the generic case (the #else for all the platform specific
cases) is retained in lcd.h as the default case.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 include/atmel_lcd.h  |  38 ++
 include/exynos_lcd.h |  81 +
 include/lcd.h| 201 ++-
 include/mpc823_lcd.h |  43 +++
 include/pxa_lcd.h|  80 
 5 files changed, 247 insertions(+), 196 deletions(-)
 create mode 100644 include/atmel_lcd.h
 create mode 100644 include/exynos_lcd.h
 create mode 100644 include/mpc823_lcd.h
 create mode 100644 include/pxa_lcd.h

diff --git a/include/atmel_lcd.h b/include/atmel_lcd.h
new file mode 100644
index 000..fa8aa29
--- /dev/null
+++ b/include/atmel_lcd.h
@@ -0,0 +1,38 @@
+/*
+ * atmel_lcd.h - Atmel LCD Controller structures
+ *
+ * (C) Copyright 2001
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _ATMEL_LCD_H_
+#define _ATMEL_LCD_H_
+
+typedef struct vidinfo {
+   ushort vl_col;  /* Number of columns (i.e. 640) */
+   ushort vl_row;  /* Number of rows (i.e. 480) */
+   u_long vl_clk;  /* pixel clock in ps*/
+
+   /* LCD configuration register */
+   u_long vl_sync; /* Horizontal / vertical sync */
+   u_long vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
+   u_long vl_tft;  /* 0 = passive, 1 = TFT */
+   u_long vl_cont_pol_low; /* contrast polarity is low */
+   u_long vl_clk_pol;  /* clock polarity */
+
+   /* Horizontal control register. */
+   u_long vl_hsync_len;/* Length of horizontal sync */
+   u_long vl_left_margin;  /* Time from sync to picture */
+   u_long vl_right_margin; /* Time from picture to sync */
+
+   /* Vertical control register. */
+   u_long vl_vsync_len;/* Length of vertical sync */
+   u_long vl_upper_margin; /* Time from sync to picture */
+   u_long vl_lower_margin; /* Time from picture to sync */
+
+   u_long  mmio;   /* Memory mapped registers */
+} vidinfo_t;
+
+#endif
diff --git a/include/exynos_lcd.h b/include/exynos_lcd.h
new file mode 100644
index 000..cf389da
--- /dev/null
+++ b/include/exynos_lcd.h
@@ -0,0 +1,81 @@
+/*
+ * exynos_lcd.h - Exynos LCD Controller structures
+ *
+ * (C) Copyright 2001
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _EXYNOS_LCD_H_
+#define _EXYNOS_LCD_H_
+
+enum {
+   FIMD_RGB_INTERFACE = 1,
+   FIMD_CPU_INTERFACE = 2,
+};
+
+enum exynos_fb_rgb_mode_t {
+   MODE_RGB_P = 0,
+   MODE_BGR_P = 1,
+   MODE_RGB_S = 2,
+   MODE_BGR_S = 3,
+};
+
+typedef struct vidinfo {
+   ushort vl_col;  /* Number of columns (i.e. 640) */
+   ushort vl_row;  /* Number of rows (i.e. 480) */
+   ushort vl_width;/* Width of display area in millimeters */
+   ushort vl_height;   /* Height of display area in millimeters */
+
+   /* LCD configuration register */
+   u_char vl_freq; /* Frequency */
+   u_char vl_clkp; /* Clock polarity */
+   u_char vl_oep;  /* Output Enable polarity */
+   u_char vl_hsp;  /* Horizontal Sync polarity */
+   u_char vl_vsp;  /* Vertical Sync polarity */
+   u_char vl_dp;   /* Data polarity */
+   u_char vl_bpix; /* Bits per pixel */
+
+   /* Horizontal control register. Timing from data sheet */
+   u_char vl_hspw; /* Horz sync pulse width */
+   u_char vl_hfpd; /* Wait before of line */
+   u_char vl_hbpd; /* Wait end of line */
+
+   /* Vertical control register. */
+   u_char  vl_vspw;/* Vertical sync pulse width */
+   u_char  vl_vfpd;/* Wait before of frame */
+   u_char  vl_vbpd;/* Wait end of frame */
+   u_char  vl_cmd_allow_len; /* Wait end of frame */
+
+   unsigned int win_id;
+   unsigned int init_delay;
+   unsigned int power_on_delay;
+   unsigned int reset_delay;
+   unsigned int interface_mode;
+   unsigned int mipi_enabled;
+   unsigned int dp_enabled;
+   unsigned int cs_setup;
+   unsigned int wr_setup;
+   unsigned int wr_act;
+   unsigned int wr_hold;
+   unsigned int logo_on;
+   unsigned int logo_width;
+   unsigned int logo_height;
+   int logo_x_offset;
+   int logo_y_offset;
+   unsigned long logo_addr;
+   unsigned int rgb_mode;
+   unsigned int resolution;
+
+   /* parent clock name(MPLL, EPLL or VPLL) */
+   unsig

[U-Boot] [PATCH 10/13] lcd: various cleanups

2015-01-29 Thread Nikita Kiryanov
This cleanup mostly focuses on removing unnecessary whitespace and comments
which are superfluous and/or do not conform to the coding style.

Signed-off-by: Nikita Kiryanov 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c  |  90 +--
 include/lcd.h | 102 --
 2 files changed, 49 insertions(+), 143 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 7a51923..06eec45 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -1,5 +1,5 @@
 /*
- * Common LCD routines for supported CPUs
+ * Common LCD routines
  *
  * (C) Copyright 2001-2002
  * Wolfgang Denk, DENX Software Engineering -- w...@denx.de
@@ -7,12 +7,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-//
-/* ** HEADER FILES */
-//
-
 /* #define DEBUG */
-
 #include 
 #include 
 #include 
@@ -26,25 +21,18 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(CONFIG_LCD_DT_SIMPLEFB)
 #include 
 #endif
 
-//
-/* ** FONT DATA
*/
-//
-#include /* Get font data, width and height  
*/
-
-//
-/* ** LOGO DATA
*/
-//
 #ifdef CONFIG_LCD_LOGO
-# include  /* Get logo data, width and height  */
-# include 
-# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16)
-#  error Default Color Map overlaps with Logo Color Map
-# endif
+#include 
+#include 
+#if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16)
+#error Default Color Map overlaps with Logo Color Map
+#endif
 #endif
 
 #ifdef CONFIG_SANDBOX
@@ -57,30 +45,23 @@
 
 #if (LCD_BPP != LCD_COLOR8) && (LCD_BPP != LCD_COLOR16) && \
(LCD_BPP != LCD_COLOR32)
-# error Unsupported LCD BPP.
+#error Unsupported LCD BPP.
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
 static int lcd_init(void *lcdbase);
-
 static void *lcd_logo(void);
-
 static void lcd_setfgcolor(int color);
 static void lcd_setbgcolor(int color);
 
 static int lcd_color_fg;
 static int lcd_color_bg;
 int lcd_line_length;
-
 char lcd_is_enabled = 0;
-
 static void *lcd_base; /* Start of framebuffer memory  */
-
 static char lcd_flush_dcache;  /* 1 to flush dcache after each lcd update */
 
-//
-
 /* Flush LCD activity to the caches */
 void lcd_sync(void)
 {
@@ -110,8 +91,6 @@ void lcd_set_flush_dcache(int flush)
lcd_flush_dcache = (flush != 0);
 }
 
-/*--*/
-
 static void lcd_stub_putc(struct stdio_dev *dev, const char c)
 {
lcd_putc(c);
@@ -122,9 +101,7 @@ static void lcd_stub_puts(struct stdio_dev *dev, const char 
*s)
lcd_puts(s);
 }
 
-//
-/**  Small utility to check that you got the colours right */
-//
+/* Small utility to check that you got the colours right */
 #ifdef LCD_TEST_PATTERN
 
 #defineN_BLK_VERT  2
@@ -158,10 +135,6 @@ static void test_pattern(void)
 }
 #endif /* LCD_TEST_PATTERN */
 
-
-//
-/* ** GENERIC Initialization Routines  */
-//
 /*
  * With most lcd drivers the line length is set up
  * by calculating it from panel_info parameters. Some
@@ -181,7 +154,7 @@ int drv_lcd_init(void)
 
lcd_base = map_sysmem(gd->fb_base, 0);
 
-   lcd_init(lcd_base); /* LCD initialization */
+   lcd_init(lcd_base);
 
/* Device initialization */
memset(&lcddev, 0, sizeof(lcddev));
@@ -197,7 +170,6 @@ int drv_lcd_init(void)
return (rc == 0) ? 1 : rc;
 }
 
-/*--*/
 void lcd_clear(void)
 {
short console_rows, console_cols;
@@ -261,20 +233,11 @@ static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int 
argc,
lcd_clear();
return 0;
 }
-
-U_BOOT_CMD(
-   cls,1,  1,  do_lcd_clear,
-   "clear screen",
-   ""
-);
-
-/*--*/
+U_BOOT_CMD(cls,1, 1, do_lcd_clear, "clear screen", "");
 
 static int lcd_init(void *lcdbase)
 {
- 

[U-Boot] [PATCH 03/13] lcd: atmel: move atmel specific fb_put_word to atmel_lcdfb

2015-01-29 Thread Nikita Kiryanov
Reduce the amount of platform dependant code in common/lcd.c by moving Atmel
specific implementation of fb_put_word() to atmel_lcdfb.c. Since we must also
have a default implementation for everybody else, make the remainder of the
code into a weak function.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c| 11 +--
 drivers/video/atmel_lcdfb.c |  9 +
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 0f6c2e4..f17b35b 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -642,20 +642,11 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, 
ushort *cmap, uchar *fb,
 #endif
 
 #if defined(CONFIG_BMP_16BPP)
-#if defined(CONFIG_ATMEL_LCD_BGR555)
-static inline void fb_put_word(uchar **fb, uchar **from)
-{
-   *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
-   *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
-   *from += 2;
-}
-#else
-static inline void fb_put_word(uchar **fb, uchar **from)
+__weak void fb_put_word(uchar **fb, uchar **from)
 {
*(*fb)++ = *(*from)++;
*(*fb)++ = *(*from)++;
 }
-#endif
 #endif /* CONFIG_BMP_16BPP */
 
 int lcd_display_bitmap(ulong bmp_image, int x, int y)
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index fa6a82c..c7991cd 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -34,6 +34,15 @@ ushort *configuration_get_cmap(void)
return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
 }
 
+#if defined(CONFIG_BMP_16BPP) && defined(CONFIG_ATMEL_LCD_BGR555)
+void fb_put_word(uchar **fb, uchar **from)
+{
+   *(*fb)++ = (((*from)[0] & 0x1f) << 2) | ((*from)[1] & 0x03);
+   *(*fb)++ = ((*from)[0] & 0xe0) | (((*from)[1] & 0x7c) >> 2);
+   *from += 2;
+}
+#endif
+
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
 {
 #if defined(CONFIG_ATMEL_LCD_BGR555)
-- 
1.9.1

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


[U-Boot] [PATCH 07/13] lcd: logo: move generic cmap setting to lcd_logo_set_cmap()

2015-01-29 Thread Nikita Kiryanov
Get rid of platform specific #ifdefs in bitmap_plot() by moving the generic
case of setting cmap into the weak lcd_logo_set_cmap().

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c | 28 +++-
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 355c144..dcee3c0 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -387,44 +387,30 @@ int lcd_getbgcolor(void)
 #ifdef CONFIG_LCD_LOGO
 __weak void lcd_logo_set_cmap(void)
 {
+   int i;
+   ushort *cmap = configuration_get_cmap();
+
+   for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i)
+   *cmap++ = bmp_logo_palette[i];
 }
 
 void bitmap_plot(int x, int y)
 {
-   ushort *cmap = (ushort *)bmp_logo_palette;
ushort i, j;
uchar *bmap;
uchar *fb;
ushort *fb16;
unsigned bpix = NBITS(panel_info.vl_bpix);
 
-   debug("Logo: width %d  height %d  colors %d  cmap %d\n",
-   BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
-   ARRAY_SIZE(bmp_logo_palette));
+   debug("Logo: width %d  height %d  colors %d\n",
+ BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS);
 
bmap = &bmp_logo_bitmap[0];
fb   = (uchar *)(lcd_base + y * lcd_line_length + x * bpix / 8);
 
if (bpix < 12) {
-   /* Leave room for default color map
-* default case: generic system with no cmap (most likely 16bpp)
-* cmap was set to the source palette, so no change is done.
-* This avoids even more ifdefs in the next stanza
-*/
-   cmap = configuration_get_cmap();
-
WATCHDOG_RESET();
-
-   /* Set color map */
-#if defined(CONFIG_ATMEL_LCD) || defined(CONFIG_MPC823)
lcd_logo_set_cmap();
-#else
-   for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i) {
-   ushort colreg = bmp_logo_palette[i];
-   *cmap++ = colreg;
-   }
-#endif
-
WATCHDOG_RESET();
 
for (i = 0; i < BMP_LOGO_HEIGHT; ++i) {
-- 
1.9.1

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


[U-Boot] [PATCH 06/13] lcd: mpc823: move mpc823 specific lcd_logo_set_cmap code to mpc8xx_lcd.c

2015-01-29 Thread Nikita Kiryanov
Reduce the bitmap_plot #ifdef complexity by extracting MPC823 specific code for
setting cmap into its own implementation of lcd_logo_set_cmap(), implemented in
mpc8xx_lcd.c. In the MPC823 implementation, ARRAY_SIZE(bmp_logo_palette) is
switched for BMP_LOGO_COLORS to avoid having to include bmp_logo_data.h, which
would cause a compilation error because the logo data and palette arrays would
be defined twice.

Signed-off-by: Nikita Kiryanov 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c   | 10 +-
 drivers/video/mpc8xx_lcd.c | 15 +++
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 7fcac1d..355c144 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -396,10 +396,6 @@ void bitmap_plot(int x, int y)
uchar *bmap;
uchar *fb;
ushort *fb16;
-#if defined(CONFIG_MPC823)
-   immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-   cpm8xx_t *cp = &(immr->im_cpm);
-#endif
unsigned bpix = NBITS(panel_info.vl_bpix);
 
debug("Logo: width %d  height %d  colors %d  cmap %d\n",
@@ -415,16 +411,12 @@ void bitmap_plot(int x, int y)
 * cmap was set to the source palette, so no change is done.
 * This avoids even more ifdefs in the next stanza
 */
-#if defined(CONFIG_MPC823)
-   cmap = (ushort *) &(cp->lcd_cmap[BMP_LOGO_OFFSET * 
sizeof(ushort)]);
-#else
cmap = configuration_get_cmap();
-#endif
 
WATCHDOG_RESET();
 
/* Set color map */
-#ifdef CONFIG_ATMEL_LCD
+#if defined(CONFIG_ATMEL_LCD) || defined(CONFIG_MPC823)
lcd_logo_set_cmap();
 #else
for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i) {
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 190c05a..faa58c0 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -371,6 +371,21 @@ void fb_put_byte(uchar **fb, uchar **from)
 }
 #endif
 
+#ifdef CONFIG_LCD_LOGO
+#include 
+void lcd_logo_set_cmap(void)
+{
+   int i;
+   ushort *cmap;
+   immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+   cpm8xx_t *cp = &(immr->im_cpm);
+   cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET * sizeof(ushort)]);
+
+   for (i = 0; i < BMP_LOGO_COLORS; ++i)
+   *cmap++ = bmp_logo_palette[i];
+}
+#endif
+
 void lcd_enable (void)
 {
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-- 
1.9.1

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


[U-Boot] [PATCH 08/13] lcd: introduce lcd_set_cmap

2015-01-29 Thread Nikita Kiryanov
Reduce the lcd_display_bitmap #ifdef complexity by extracting Atmel specific
code for setting cmap for bitmap images into a new function lcd_set_cmap().
A default version is implemented with the remainder of the code.

Signed-off-by: Nikita Kiryanov 
Cc: Bo Shen 
Cc: Simon Glass 
Cc: Anatolij Gustschin 
---
 common/lcd.c| 46 ++---
 drivers/video/atmel_lcdfb.c | 11 +++
 2 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index dcee3c0..8a8d6c3 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -613,9 +613,27 @@ __weak void fb_put_word(uchar **fb, uchar **from)
 }
 #endif /* CONFIG_BMP_16BPP */
 
+__weak void lcd_set_cmap(bmp_image_t *bmp, unsigned colors)
+{
+   int i;
+   bmp_color_table_entry_t cte;
+   ushort *cmap = configuration_get_cmap();
+
+   for (i = 0; i < colors; ++i) {
+   cte = bmp->color_table[i];
+   *cmap = (((cte.red)   << 8) & 0xf800) |
+   (((cte.green) << 3) & 0x07e0) |
+   (((cte.blue)  >> 3) & 0x001f);
+#if defined(CONFIG_MPC823)
+   cmap--;
+#else
+   cmap++;
+#endif
+   }
+}
+
 int lcd_display_bitmap(ulong bmp_image, int x, int y)
 {
-   ushort *cmap = NULL;
ushort *cmap_base = NULL;
ushort i, j;
uchar *fb;
@@ -663,29 +681,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
debug("Display-bmp: %d x %d  with %d colors\n",
(int)width, (int)height, (int)colors);
 
-   if (bmp_bpix == 8) {
-   cmap = configuration_get_cmap();
-   cmap_base = cmap;
-
-   /* Set color map */
-   for (i = 0; i < colors; ++i) {
-   bmp_color_table_entry_t cte = bmp->color_table[i];
-#if !defined(CONFIG_ATMEL_LCD)
-   ushort colreg =
-   ( ((cte.red)   << 8) & 0xf800) |
-   ( ((cte.green) << 3) & 0x07e0) |
-   ( ((cte.blue)  >> 3) & 0x001f) ;
-   *cmap = colreg;
-#if defined(CONFIG_MPC823)
-   cmap--;
-#else
-   cmap++;
-#endif
-#else /* CONFIG_ATMEL_LCD */
-   lcd_setcolreg(i, cte.red, cte.green, cte.blue);
-#endif
-   }
-   }
+   if (bmp_bpix == 8)
+   lcd_set_cmap(bmp, colors);
 
padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width);
 
@@ -706,6 +703,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
switch (bmp_bpix) {
case 1: /* pass through */
case 8: {
+   cmap_base = configuration_get_cmap();
 #ifdef CONFIG_LCD_BMP_RLE8
u32 compression = get_unaligned_le32(&bmp->header.compression);
if (compression == BMP_BI_RLE8) {
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 2a71eba..5add136 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /* configurable parameters */
@@ -80,6 +81,16 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, 
ushort blue)
 #endif
 }
 
+void lcd_set_cmap(bmp_image_t *bmp, unsigned colors)
+{
+   int i;
+
+   for (i = 0; i < colors; ++i) {
+   bmp_color_table_entry_t cte = bmp->color_table[i];
+   lcd_setcolreg(i, cte.red, cte.green, cte.blue);
+   }
+}
+
 void lcd_ctrl_init(void *lcdbase)
 {
unsigned long value;
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 0/8] MIPS cache code cleanup

2015-01-29 Thread Daniel Schwierzeck
2015-01-29 2:27 GMT+01:00 Paul Burton :
> This series cleans up the MIPS cache code somewhat, and unifies the
> mips32 & mips64 implementations of it. This is largely in preparation
> for further patches adding L2 cache support. The final patch of this
> series fixes a bug encountered with recent cores on Malta boards.
>
> Paul Burton (8):
>   MIPS: avoid .set ISA for cache operations
>   MIPS: unify cache maintenance functions
>   MIPS: unify cache initialization code
>   MIPS: refactor L1 cache config reads to a macro
>   MIPS: refactor cache loops to a macro
>   MIPS: inline mips_init_[id]cache functions
>   MIPS: allow systems to skip loads during cache init
>   MIPS: clear TagLo select 2 during cache init
>

all patches applied to u-boot-mips/master, thanks

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


Re: [U-Boot] [PATCH 0/4] malta: IDE support, reset fix, config updates

2015-01-29 Thread Daniel Schwierzeck
2015-01-29 11:38 GMT+01:00 Paul Burton :
> This series includes a few assorted improvements to the MIPS Malta board
> support.
>
> Paul Burton (4):
>   malta: IDE support
>   malta: delay after reset
>   malta: enable HUSH parser
>   malta: enable ELF loading
>

all patches applied to u-boot-mips/master, thanks

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


[U-Boot] [PATCH] MIPS: unify CPU code in arch/mips/cpu/

2015-01-29 Thread Daniel Schwierzeck
Unify and move code in arch/mips/cpu/mips[32|64]/ to arch/mips/cpu/.
The CPU specific config.mk files need to remain until
CONFIG_STANDALONE_LOAD_ADDR is converted to a global Kconfig symbol.

Signed-off-by: Paul Burton 
Signed-off-by: Daniel Schwierzeck 
---
 arch/mips/Makefile|   6 +-
 arch/mips/cpu/Makefile|   9 ++
 arch/mips/cpu/cpu.c   |  38 +
 arch/mips/cpu/interrupts.c|  22 +++
 arch/mips/cpu/mips32/Makefile |   9 --
 arch/mips/cpu/mips32/cpu.c|  34 
 arch/mips/cpu/mips32/interrupts.c |  22 ---
 arch/mips/cpu/mips32/start.S  | 320 --
 arch/mips/cpu/mips32/time.c   |  19 ---
 arch/mips/cpu/mips64/Makefile |   9 --
 arch/mips/cpu/mips64/cpu.c|  37 -
 arch/mips/cpu/mips64/interrupts.c |  22 ---
 arch/mips/cpu/mips64/start.S  | 291 --
 arch/mips/cpu/mips64/time.c   |  19 ---
 arch/mips/cpu/start.S | 320 ++
 arch/mips/cpu/time.c  |  19 +++
 16 files changed, 410 insertions(+), 786 deletions(-)
 create mode 100644 arch/mips/cpu/Makefile
 create mode 100644 arch/mips/cpu/cpu.c
 create mode 100644 arch/mips/cpu/interrupts.c
 delete mode 100644 arch/mips/cpu/mips32/Makefile
 delete mode 100644 arch/mips/cpu/mips32/cpu.c
 delete mode 100644 arch/mips/cpu/mips32/interrupts.c
 delete mode 100644 arch/mips/cpu/mips32/start.S
 delete mode 100644 arch/mips/cpu/mips32/time.c
 delete mode 100644 arch/mips/cpu/mips64/Makefile
 delete mode 100644 arch/mips/cpu/mips64/cpu.c
 delete mode 100644 arch/mips/cpu/mips64/interrupts.c
 delete mode 100644 arch/mips/cpu/mips64/start.S
 delete mode 100644 arch/mips/cpu/mips64/time.c
 create mode 100644 arch/mips/cpu/start.S
 create mode 100644 arch/mips/cpu/time.c

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index ff01bfe..43f0f5c 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -2,11 +2,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-head-$(CONFIG_CPU_MIPS32) := arch/mips/cpu/mips32/start.o
-head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o
+head-y := arch/mips/cpu/start.o
 
-libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/
-libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/
+libs-y += arch/mips/cpu/
 libs-y += arch/mips/lib/
 
 libs-$(CONFIG_SOC_AU1X00) += arch/mips/mach-au1x00/
diff --git a/arch/mips/cpu/Makefile b/arch/mips/cpu/Makefile
new file mode 100644
index 000..fc6b455
--- /dev/null
+++ b/arch/mips/cpu/Makefile
@@ -0,0 +1,9 @@
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+extra-y= start.o
+
+obj-y += time.o
+obj-y += interrupts.o
+obj-y += cpu.o
diff --git a/arch/mips/cpu/cpu.c b/arch/mips/cpu/cpu.c
new file mode 100644
index 000..8d3b2f5
--- /dev/null
+++ b/arch/mips/cpu/cpu.c
@@ -0,0 +1,38 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+void __weak _machine_restart(void)
+{
+   fprintf(stderr, "*** reset failed ***\n");
+
+   while (1)
+   /* NOP */;
+}
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   _machine_restart();
+
+   return 0;
+}
+
+void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
+{
+   write_c0_entrylo0(low0);
+   write_c0_pagemask(pagemask);
+   write_c0_entrylo1(low1);
+   write_c0_entryhi(hi);
+   write_c0_index(index);
+   tlb_write_indexed();
+}
diff --git a/arch/mips/cpu/interrupts.c b/arch/mips/cpu/interrupts.c
new file mode 100644
index 000..275fcf5
--- /dev/null
+++ b/arch/mips/cpu/interrupts.c
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+int interrupt_init(void)
+{
+   return 0;
+}
+
+void enable_interrupts(void)
+{
+}
+
+int disable_interrupts(void)
+{
+   return 0;
+}
diff --git a/arch/mips/cpu/mips32/Makefile b/arch/mips/cpu/mips32/Makefile
deleted file mode 100644
index cb4db9c..000
--- a/arch/mips/cpu/mips32/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-extra-y= start.o
-obj-y  = cpu.o interrupts.o time.o
diff --git a/arch/mips/cpu/mips32/cpu.c b/arch/mips/cpu/mips32/cpu.c
deleted file mode 100644
index 07deca8..000
--- a/arch/mips/cpu/mips32/cpu.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-void __attribute__((weak)) _machine_restart(void)
-{
-}
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-   _machine_restart();
-
-   fprintf(stderr, 

[U-Boot] [PATCH] MIPS: move au1x00 SoC code to arch/mips/mach-au1x00

2015-01-29 Thread Daniel Schwierzeck
Move all au1x00 code out of arch/mips/cpu/mips32 to allow
unification of CPU code in a later patch. The reorganization
of the SoC specific header files will be done in a later patch
series.

Signed-off-by: Daniel Schwierzeck 
Cc: Paul Burton 
---
 arch/mips/Makefile | 2 ++
 arch/mips/cpu/mips32/Makefile  | 2 --
 arch/mips/cpu/mips32/cpu.c | 8 
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/Makefile  | 0
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_eth.c  | 6 ++
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_ide.c  | 0
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_serial.c   | 0
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_usb_ohci.c | 0
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_usb_ohci.h | 0
 arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/config.mk | 0
 10 files changed, 8 insertions(+), 10 deletions(-)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/Makefile (100%)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_eth.c (98%)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_ide.c (100%)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_serial.c (100%)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_usb_ohci.c (100%)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/au1x00_usb_ohci.h (100%)
 rename arch/mips/{cpu/mips32/au1x00 => mach-au1x00}/config.mk (100%)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 0a9e7e6..ff01bfe 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -8,3 +8,5 @@ head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o
 libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/
 libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/
 libs-y += arch/mips/lib/
+
+libs-$(CONFIG_SOC_AU1X00) += arch/mips/mach-au1x00/
diff --git a/arch/mips/cpu/mips32/Makefile b/arch/mips/cpu/mips32/Makefile
index 19d316a..cb4db9c 100644
--- a/arch/mips/cpu/mips32/Makefile
+++ b/arch/mips/cpu/mips32/Makefile
@@ -7,5 +7,3 @@
 
 extra-y= start.o
 obj-y  = cpu.o interrupts.o time.o
-
-obj-$(CONFIG_SOC_AU1X00) += au1x00/
diff --git a/arch/mips/cpu/mips32/cpu.c b/arch/mips/cpu/mips32/cpu.c
index 8e1cc4e..07deca8 100644
--- a/arch/mips/cpu/mips32/cpu.c
+++ b/arch/mips/cpu/mips32/cpu.c
@@ -32,11 +32,3 @@ void write_one_tlb(int index, u32 pagemask, u32 hi, u32 
low0, u32 low1)
write_c0_index(index);
tlb_write_indexed();
 }
-
-int cpu_eth_init(bd_t *bis)
-{
-#ifdef CONFIG_SOC_AU1X00
-   au1x00_enet_initialize(bis);
-#endif
-   return 0;
-}
diff --git a/arch/mips/cpu/mips32/au1x00/Makefile 
b/arch/mips/mach-au1x00/Makefile
similarity index 100%
rename from arch/mips/cpu/mips32/au1x00/Makefile
rename to arch/mips/mach-au1x00/Makefile
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c 
b/arch/mips/mach-au1x00/au1x00_eth.c
similarity index 98%
rename from arch/mips/cpu/mips32/au1x00/au1x00_eth.c
rename to arch/mips/mach-au1x00/au1x00_eth.c
index 4770f56..39c5b6b 100644
--- a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
+++ b/arch/mips/mach-au1x00/au1x00_eth.c
@@ -294,3 +294,9 @@ int au1x00_enet_initialize(bd_t *bis){
 
return 1;
 }
+
+int cpu_eth_init(bd_t *bis)
+{
+   au1x00_enet_initialize(bis);
+   return 0;
+}
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_ide.c 
b/arch/mips/mach-au1x00/au1x00_ide.c
similarity index 100%
rename from arch/mips/cpu/mips32/au1x00/au1x00_ide.c
rename to arch/mips/mach-au1x00/au1x00_ide.c
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_serial.c 
b/arch/mips/mach-au1x00/au1x00_serial.c
similarity index 100%
rename from arch/mips/cpu/mips32/au1x00/au1x00_serial.c
rename to arch/mips/mach-au1x00/au1x00_serial.c
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c 
b/arch/mips/mach-au1x00/au1x00_usb_ohci.c
similarity index 100%
rename from arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
rename to arch/mips/mach-au1x00/au1x00_usb_ohci.c
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.h 
b/arch/mips/mach-au1x00/au1x00_usb_ohci.h
similarity index 100%
rename from arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.h
rename to arch/mips/mach-au1x00/au1x00_usb_ohci.h
diff --git a/arch/mips/cpu/mips32/au1x00/config.mk 
b/arch/mips/mach-au1x00/config.mk
similarity index 100%
rename from arch/mips/cpu/mips32/au1x00/config.mk
rename to arch/mips/mach-au1x00/config.mk
-- 
1.9.1

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


Re: [U-Boot] [PATCH 0/4] MIPS: unify start.S

2015-01-29 Thread Daniel Schwierzeck
Hi Paul,

2015-01-29 11:04 GMT+01:00 Paul Burton :
> Currently we have mips32-specific & mips64-specific versions of start.S,
> which are very similar. This short series adapts the mips32 start.S to
> also be suitable for mips64 systems & then shares that single copy
> between mips32 & mips64 builds.
>
> Paul Burton (4):
>   MIPS: use asm.h macros in mips32 start.S
>   MIPS: handle mips64 relocs in mips32 start.S
>   MIPS: handle mips64 ST0_KX bit in mips32 start.S
>   MIPS: share start.S between mips32 & mips64
>

very appreciated, thanks. But I'd like to replace patch 4/4 with

http://patchwork.ozlabs.org/patch/434556/
http://patchwork.ozlabs.org/patch/434555/

what do you think?

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


[U-Boot] [PATCH v2] MIPS: unify CPU code in arch/mips/cpu/

2015-01-29 Thread Daniel Schwierzeck
Unify and move code in arch/mips/cpu/mips[32|64]/ to arch/mips/cpu/.
The CPU specific config.mk files need to remain until
CONFIG_STANDALONE_LOAD_ADDR is converted to a global Kconfig symbol.

Signed-off-by: Paul Burton 
Signed-off-by: Daniel Schwierzeck 
---
Changes for v2:
- resend with git rename detection enabled
---
 arch/mips/Makefile  |   6 +-
 arch/mips/cpu/Makefile  |   9 +
 arch/mips/cpu/{mips64 => }/cpu.c|   3 +-
 arch/mips/cpu/{mips32 => }/interrupts.c |   0
 arch/mips/cpu/mips32/Makefile   |   9 -
 arch/mips/cpu/mips32/cpu.c  |  34 
 arch/mips/cpu/mips64/Makefile   |   9 -
 arch/mips/cpu/mips64/interrupts.c   |  22 ---
 arch/mips/cpu/mips64/start.S| 291 
 arch/mips/cpu/mips64/time.c |  19 ---
 arch/mips/cpu/{mips32 => }/start.S  |   0
 arch/mips/cpu/{mips32 => }/time.c   |   0
 12 files changed, 13 insertions(+), 389 deletions(-)
 create mode 100644 arch/mips/cpu/Makefile
 rename arch/mips/cpu/{mips64 => }/cpu.c (91%)
 rename arch/mips/cpu/{mips32 => }/interrupts.c (100%)
 delete mode 100644 arch/mips/cpu/mips32/Makefile
 delete mode 100644 arch/mips/cpu/mips32/cpu.c
 delete mode 100644 arch/mips/cpu/mips64/Makefile
 delete mode 100644 arch/mips/cpu/mips64/interrupts.c
 delete mode 100644 arch/mips/cpu/mips64/start.S
 delete mode 100644 arch/mips/cpu/mips64/time.c
 rename arch/mips/cpu/{mips32 => }/start.S (100%)
 rename arch/mips/cpu/{mips32 => }/time.c (100%)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index ff01bfe..43f0f5c 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -2,11 +2,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-head-$(CONFIG_CPU_MIPS32) := arch/mips/cpu/mips32/start.o
-head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o
+head-y := arch/mips/cpu/start.o
 
-libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/
-libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/
+libs-y += arch/mips/cpu/
 libs-y += arch/mips/lib/
 
 libs-$(CONFIG_SOC_AU1X00) += arch/mips/mach-au1x00/
diff --git a/arch/mips/cpu/Makefile b/arch/mips/cpu/Makefile
new file mode 100644
index 000..fc6b455
--- /dev/null
+++ b/arch/mips/cpu/Makefile
@@ -0,0 +1,9 @@
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+extra-y= start.o
+
+obj-y += time.o
+obj-y += interrupts.o
+obj-y += cpu.o
diff --git a/arch/mips/cpu/mips64/cpu.c b/arch/mips/cpu/cpu.c
similarity index 91%
rename from arch/mips/cpu/mips64/cpu.c
rename to arch/mips/cpu/cpu.c
index 1d32705..8d3b2f5 100644
--- a/arch/mips/cpu/mips64/cpu.c
+++ b/arch/mips/cpu/cpu.c
@@ -8,10 +8,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-void __attribute__((weak)) _machine_restart(void)
+void __weak _machine_restart(void)
 {
fprintf(stderr, "*** reset failed ***\n");
 
diff --git a/arch/mips/cpu/mips32/interrupts.c b/arch/mips/cpu/interrupts.c
similarity index 100%
rename from arch/mips/cpu/mips32/interrupts.c
rename to arch/mips/cpu/interrupts.c
diff --git a/arch/mips/cpu/mips32/Makefile b/arch/mips/cpu/mips32/Makefile
deleted file mode 100644
index cb4db9c..000
--- a/arch/mips/cpu/mips32/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-extra-y= start.o
-obj-y  = cpu.o interrupts.o time.o
diff --git a/arch/mips/cpu/mips32/cpu.c b/arch/mips/cpu/mips32/cpu.c
deleted file mode 100644
index 07deca8..000
--- a/arch/mips/cpu/mips32/cpu.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-void __attribute__((weak)) _machine_restart(void)
-{
-}
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-   _machine_restart();
-
-   fprintf(stderr, "*** reset failed ***\n");
-   return 0;
-}
-
-void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
-{
-   write_c0_entrylo0(low0);
-   write_c0_pagemask(pagemask);
-   write_c0_entrylo1(low1);
-   write_c0_entryhi(hi);
-   write_c0_index(index);
-   tlb_write_indexed();
-}
diff --git a/arch/mips/cpu/mips64/Makefile b/arch/mips/cpu/mips64/Makefile
deleted file mode 100644
index cb4db9c..000
--- a/arch/mips/cpu/mips64/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2003-2006
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-extra-y= start.o
-obj-y  = cpu.o interrupts.o time.o
diff --git a/arch/mips/cpu/mips64/interrupts.c 
b/arch/mips/cpu/mips64/interrupts.c
deleted file mode 100644
index 275fcf5..000
--- a/arch/mips/cpu/mips64/interrupts.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, 
- *
- * SPDX-Licens

Re: [U-Boot] spl: Change printf to puts for "Unsupported boot-device"

2015-01-29 Thread Tom Rini
On Tue, Jan 27, 2015 at 04:45:09PM +0100, Stefan Roese wrote:

> Microblaze currently doesn't use printf in SPL. So this one line was the only
> reference to it and resulted in the printf functionality to be pulled in.
> Exceeding the 4k size limit. Lets change the printf back to puts so that
> Microblaze is fixed again. The only drawback is that the detected boot-device
> number will not be printed. But this message alone should be helpful enough
> to get an idea where the boot process is broken.
> 
> Signed-off-by: Stefan Roese 
> Cc: Tom Rini 
> Cc: Michal Simek 
> Acked-by: Michal Simek 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Makefile: clean boot.bin

2015-01-29 Thread Tom Rini
On Thu, Jan 15, 2015 at 10:03:53AM +0800, Bo Shen wrote:

> When build for Atmel related boards which support SPL,
> it will generate boot.bin, also clean when it when do
> "make clean" operation.
> 
> Signed-off-by: Bo Shen 
> Acked-by: Masahiro Yamada 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] lcd: fix console address is not initialized

2015-01-29 Thread Tom Rini
On Wed, Jan 28, 2015 at 09:13:22AM +0800, Bo Shen wrote:

> This commit 904672e (lcd: refactor lcd console stuff into its
> own file), which cause lcd console address is not initialized.
> 
> This patch initialize the lcd console use the default value,
> will be update when splash screen is enabled.
> 
> Signed-off-by: Bo Shen 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-video/master

2015-01-29 Thread Tom Rini
On Thu, Jan 29, 2015 at 10:06:57AM +0100, Anatolij Gustschin wrote:

> Hey Tom,
> 
> The following changes since commit ab92da9f47d51d363c7de42e2a7bd807e2c1bd54:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-x86 (2015-01-26 17:44:49 
> -0500)
> 
> are available in the git repository at:
> 
> 
>   git://git.denx.de/u-boot-video.git master
> 
> for you to fetch changes up to 717e3a74fa71fac9b60e70c5c6a0decc11e54b10:
> 
>   lcd: fix console address is not initialized (2015-01-29 09:29:30 +0100)
> 
> 
> Bo Shen (1):
>   lcd: fix console address is not initialized
> 
>  common/lcd.c |1 +
>  1 file changed, 1 insertion(+)
> 
> Please pull. Thanks!

Sorry, I had this change queued up already.

-- 
Tom


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


Re: [U-Boot] [PATCH 12/14] microblaze: Move architecture to use generic board init

2015-01-29 Thread Simon Glass
Hi Michal,

On 27 January 2015 at 08:20, Michal Simek  wrote:
> Compile code with -fPIC to get GOT. Do not build SPL
> with fPIC because it increasing SPL size for nothing.
>
> Signed-off-by: Michal Simek 
> ---
>
> This code requires
> "common/board_r: manual relocation for cmd table"
> http://lists.denx.de/pipermail/u-boot/2015-January/201965.html
>
> Not fully happy about it because compare to previous solution adds
> almost +60k on size for doing the same thing as before.
>
> 15: microblaze: Move architecture to use generic board init
> microblaze: (for 1/1 boards)  all +52268.0  bss -4.0  data +11724.0
> rodata -2676.0  spl/u-boot-spl:all +36.0  spl/u-boot-spl:data +36.0
> text +43224.0
> microblaze-generic:  all +52268  bss -4  data +11724  rodata
> -2676  spl/u-boot-spl:all +36  spl/u-boot-spl:data +36  text +43224
> ---
>  arch/microblaze/config.mk  |   5 +
>  arch/microblaze/cpu/start.S| 103 +++
>  arch/microblaze/cpu/u-boot.lds |   9 +
>  arch/microblaze/include/asm/config.h   |   8 +
>  arch/microblaze/include/asm/u-boot.h   |  11 +-
>  arch/microblaze/lib/Makefile   |   1 -
>  arch/microblaze/lib/board.c| 201 
> -
>  .../xilinx/microblaze-generic/microblaze-generic.c |  46 +
>  common/board_f.c   |   6 +-
>  common/board_r.c   |   2 +-
>  common/cmd_bdinfo.c|  13 +-
>  include/configs/microblaze-generic.h   |  64 +--
>  12 files changed, 196 insertions(+), 273 deletions(-)
>  delete mode 100644 arch/microblaze/lib/board.c
>
> diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
> index 98bbf794fa7d..2b817be61a5d 100644
> --- a/arch/microblaze/config.mk
> +++ b/arch/microblaze/config.mk
> @@ -15,3 +15,8 @@ endif
>  CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
>
>  PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
> +
> +ifeq ($(CONFIG_SPL_BUILD),)
> +PLATFORM_CPPFLAGS += -fPIC
> +endif
> +__HAVE_ARCH_GENERIC_BOARD := y
> diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
> index 14c2f12da06b..3de0e12090ea 100644
> --- a/arch/microblaze/cpu/start.S
> +++ b/arch/microblaze/cpu/start.S
> @@ -150,6 +150,7 @@ clear_bss:
> bneir6, 2b
>  3: /* jumping to board_init */
>  #ifndef CONFIG_SPL_BUILD
> +   or  r5, r0, r0  /* flags - empty */
> braiboard_init_f
>  #else
> addir31, r0, CONFIG_SYS_SPL_MALLOC_END
> @@ -190,4 +191,106 @@ out16:bslli   r3, r6, 8
> rtsdr15, 8
> or  r0, r0, r0
> .endout16
> +
> +/*
> + * Relocate u-boot
> + */
> +   .text
> +   .global relocate_code
> +   .entrelocate_code
> +   .align  2
> +relocate_code:
> +   /*
> +* r5 - start_addr_sp
> +* r6 - new_gd
> +* r7 - reloc_addr
> +*/
> +   addir1, r5, 0 /* Start to use new SP */
> +   addir31, r6, 0 /* Start to use new GD */
> +
> +   add r23, r0, r7 /* Move reloc addr to r23 */
> +   /* Relocate text and data - r12 temp value */
> +   addir21, r0, _start
> +   addir22, r0, __end - 4 /* Include BSS too */
> +1: lwi r12, r21, 0 /* Load u-boot data */
> +   swi r12, r23, 0 /* Write zero to loc */
> +   addir21, r21, 4 /* Increment to next loc - origin code */
> +   cmp r12, r21, r22 /* Check if we have reach the end */
> +   bneid   r12, 1b
> +   addir23, r23, 4 /* Increment to next loc - relocate code */
> +
> +   /* R23 points to the base address. */
> +   add r23, r0, r7 /* Move reloc addr to r23 */
> +   addir24, r0, CONFIG_SYS_TEXT_BASE /* Get reloc offset */
> +   rsubr23, r24, r23 /* keep - this is already here gd->reloc_off */
> +
> +   addik   r6, r0, 0x2 /* BIG/LITTLE endian offset */
> +   lwi r7, r0, 0x28
> +   swi r6, r0, 0x28 /* used first unused MB vector */
> +   lbuir10, r0, 0x28 /* used first unused MB vector */
> +   swi r7, r0, 0x28
> +
> +#ifdef CONFIG_SYS_USR_EXCEP
> +   addik   r6, r0, _exception_handler
> +   addkr6, r6, r23 /* add offset */
> +   sw  r6, r1, r0
> +   lhu r7, r1, r10
> +   rsubi   r8, r10, 0xa
> +   sh  r7, r0, r8
> +   rsubi   r8, r10, 0xe
> +   sh  r6, r0, r8
> +#endif
> +   addik   r6, r0, _hw_exception_handler
> +   addkr6, r6, r23 /* add offset */
> +   sw  r6, r1, r0
> +   lhu r7, r1, r10
> +   rsubi   r8, r10, 0x22
> +   sh  r7, r0, r8
> +   rsubi   r8, r10, 0x26
> +   sh  r6, r0, r8
> +
> +   addik   r6, r0, _interrupt_handler
> +   addkr6, r6, r23 /* add offset */
> +   sw  r6, r1, r0
> +   lhu r7, r1, r10
> +   rsubi   r8, r10, 0x12
> + 

Re: [U-Boot] [PATCH 0/3] arm: reduce .bss section clear time

2015-01-29 Thread Przemyslaw Marczak

Hello,

On 01/28/2015 03:34 PM, Pantelis Antoniou wrote:

Hi Przemyslaw,


On Jan 28, 2015, at 16:30 , Przemyslaw Marczak  wrote:

Hello,

On 01/28/2015 03:18 PM, Pantelis Antoniou wrote:

Hi Przemyslaw,


On Jan 28, 2015, at 16:10 , Przemyslaw Marczak  wrote:

Hello Stefan,

On 01/28/2015 02:12 PM, Stefan Roese wrote:

Hi Przemyslaw,

On 28.01.2015 13:55, Przemyslaw Marczak wrote:

This patchset reduces the boot time for ARM architecture,
Exynos boards, and boards with DFU enabled(ARM).

For tested Trats2 device, this was done in three steps.

First was enable the arch memcpy and memset.
The second step was enable memset for .bss clear.
The third step for reduce this operation is to keep .bss section
small as possible.

The .bss section will grow if we have a lot of static variables.
This section is cleared before jump to the relocated U-Boot,
and it's done word by word. To reduce the time for this step,
we can enable arch memset, which uses multiple ARM registers.

For configs with DFU enabled, we can find the dfu buffer in this section,
which has at least 8MB (32MB for trats2). This is a lot of useless data,
which is not required for standard boot. So this buffer should be dynamic
allocated.

Przemyslaw Marczak (3):
   exynos: config: enable arch memcpy and arch memset
   arm: relocation: clear .bss section with arch memset if defined
   dfu: mmc: file buffer: remove static allocation

  arch/arm/lib/crt0.S | 10 +-
  drivers/dfu/dfu_mmc.c   | 25 ++---
  include/configs/exynos-common.h |  3 +++
  3 files changed, 34 insertions(+), 4 deletions(-)


Looking at the commit messages of this patchset I can conclude that your
overall boot time reduction is:

from ~1527ms
to ~464ms

This is amazing! Congrats. :)



Thank you. I was also amazed.

The time results are taken with from the clock cycle counter, I think it's 
reliable. Some day I would like to check it using the oscilloscope.


We really should in general make more use of the optimized functions and
take care that the buffers (e.g. the DFU buffer in this case) are used
in a sane way.

Thanks,
Stefan




Yes you're right, I thought that Exynos config has enabled arch memcpy/set lib, 
before I checked this…



Those numbers are indeed incredible; I suppose the caches are disabled?




The caches are enabled after the relocation, in one of board_init_r calls.



How big is this .bss section? We’re talking about something that takes 1.5secs 
to clear
a few MBs of memory? This is horrible.

Even at the optimized case .5secs is too much.



The .bss section was about 32.3 MB, where the 32MB were required for dfu 
file buf. With the third patch, the .bss section is about 300k.
I'm not saying, that this is fast booting. But the achieved improvement 
is really good for this config



Best regards,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marc...@samsung.com


Regards

— Pantelis




Best regards,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marc...@samsung.com


Regards

— Pantelis



Best regards,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] lib: div64: syncronize to current kernel version

2015-01-29 Thread Nishanth Menon
Synchronize with the implementation from v3.18 tag. This allows us to
use a standardized 64 bit ops on architectures that do not natively
support 64 bit (example: 32bit ARM)

Signed-off-by: Nishanth Menon 
---
 include/linux/math64.h |  81 ++
 lib/div64.c| 132 +++--
 2 files changed, 209 insertions(+), 4 deletions(-)

diff --git a/include/linux/math64.h b/include/linux/math64.h
index 6d760d7..a10ccbb 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -2,9 +2,13 @@
 #define _LINUX_MATH64_H
 
 #include 
+#include 
 
 #if BITS_PER_LONG == 64
 
+#define div64_long(x, y) div64_s64((x), (y))
+#define div64_ul(x, y)   div64_u64((x), (y))
+
 /**
  * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
  *
@@ -27,6 +31,15 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 
*remainder)
 }
 
 /**
+ * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
+ */
+static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
+{
+   *remainder = dividend % divisor;
+   return dividend / divisor;
+}
+
+/**
  * div64_u64 - unsigned 64bit divide with 64bit divisor
  */
 static inline u64 div64_u64(u64 dividend, u64 divisor)
@@ -34,8 +47,19 @@ static inline u64 div64_u64(u64 dividend, u64 divisor)
return dividend / divisor;
 }
 
+/**
+ * div64_s64 - signed 64bit divide with 64bit divisor
+ */
+static inline s64 div64_s64(s64 dividend, s64 divisor)
+{
+   return dividend / divisor;
+}
+
 #elif BITS_PER_LONG == 32
 
+#define div64_long(x, y) div_s64((x), (y))
+#define div64_ul(x, y)   div_u64((x), (y))
+
 #ifndef div_u64_rem
 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
 {
@@ -48,10 +72,18 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, 
u32 *remainder)
 extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
 #endif
 
+#ifndef div64_u64_rem
+extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder);
+#endif
+
 #ifndef div64_u64
 extern u64 div64_u64(u64 dividend, u64 divisor);
 #endif
 
+#ifndef div64_s64
+extern s64 div64_s64(s64 dividend, s64 divisor);
+#endif
+
 #endif /* BITS_PER_LONG */
 
 /**
@@ -82,4 +114,53 @@ static inline s64 div_s64(s64 dividend, s32 divisor)
 
 u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder);
 
+static __always_inline u32
+__iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
+{
+   u32 ret = 0;
+
+   while (dividend >= divisor) {
+   /* The following asm() prevents the compiler from
+  optimising this loop into a modulo operation.  */
+   asm("" : "+rm"(dividend));
+
+   dividend -= divisor;
+   ret++;
+   }
+
+   *remainder = dividend;
+
+   return ret;
+}
+
+#if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__)
+
+#ifndef mul_u64_u32_shr
+static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
+{
+   return (u64)(((unsigned __int128)a * mul) >> shift);
+}
+#endif /* mul_u64_u32_shr */
+
+#else
+
+#ifndef mul_u64_u32_shr
+static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
+{
+   u32 ah, al;
+   u64 ret;
+
+   al = a;
+   ah = a >> 32;
+
+   ret = ((u64)al * mul) >> shift;
+   if (ah)
+   ret += ((u64)ah * mul) << (32 - shift);
+
+   return ret;
+}
+#endif /* mul_u64_u32_shr */
+
+#endif
+
 #endif /* _LINUX_MATH64_H */
diff --git a/lib/div64.c b/lib/div64.c
index 795ef0e..9b53faf 100644
--- a/lib/div64.c
+++ b/lib/div64.c
@@ -9,17 +9,21 @@
  * Generic C version of 64bit/32bit division and modulo, with
  * 64bit result and 32bit remainder.
  *
- * The fast case for (n>>32 == 0) is handled inline by do_div().
+ * The fast case for (n>>32 == 0) is handled inline by do_div().
  *
  * Code generated for this function might be very inefficient
  * for some CPUs. __div64_32() can be overridden by linking arch-specific
- * assembly versions such as arch/powerpc/lib/div64.S and arch/sh/lib/div64.S.
+ * assembly versions such as arch/ppc/lib/div64.S and arch/sh/lib/div64.S.
  */
 
+#include 
 #include 
-#include 
+#include 
 
-uint32_t __div64_32(uint64_t *n, uint32_t base)
+/* Not needed on 64bit architectures */
+#if BITS_PER_LONG == 32
+
+uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base)
 {
uint64_t rem = *n;
uint64_t b = base;
@@ -51,3 +55,123 @@ uint32_t __div64_32(uint64_t *n, uint32_t base)
*n = res;
return rem;
 }
+
+
+#ifndef div_s64_rem
+s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
+{
+   u64 quotient;
+
+   if (dividend < 0) {
+   quotient = div_u64_rem(-dividend, abs(divisor), (u32 
*)remainder);
+   *remainder = -*remainder;
+   if (divisor > 0)
+   quotient = -quotient;
+   } else {
+   quotient = div_u64_rem(divide

Re: [U-Boot] [PATCH 12/14] microblaze: Move architecture to use generic board init

2015-01-29 Thread Simon Glass
Hi Michal,


On 29 January 2015 at 07:20, Michal Simek  wrote:
> Hi Simon,
>
> On 01/29/2015 03:15 AM, Simon Glass wrote:
>> Hi Michal,
>>
>> On 27 January 2015 at 08:20, Michal Simek  wrote:
>>> Compile code with -fPIC to get GOT. Do not build SPL
>>> with fPIC because it increasing SPL size for nothing.
>>>
>>> Signed-off-by: Michal Simek 
>>> ---
>>>
>
> ...
>
>>> -#if defined(CONFIG_MIPS) || defined(CONFIG_PPC)
>>> +#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || 
>>> defined(CONFIG_MICROBLAZE)
>>>  static int init_func_ram(void)
>>>  {
>>
>> Can you use dram_init() instead?
>
> No problem will do it in v2.
>
> Where dram_init(void) should be declared?
> I see that others have it in arch header. Maybe better to have
> it in any shared location.

Yes a shared location makes sense.

>
>>> --- a/common/board_r.c
>>> +++ b/common/board_r.c
>>> @@ -829,7 +829,7 @@ init_fnc_t init_sequence_r[] = {
>>>  #if defined(CONFIG_ARM)
>>> initr_enable_interrupts,
>>>  #endif
>>> -#ifdef CONFIG_X86
>>> +#if defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE)
>>> timer_init, /* initialize timer */
>>>  #endif
>>
>> Could you use interrupt_init() immediately before?
>
> What do you mean by that?
> Do you want to do timer_init in interrupt_init()?

Yes, then if we remove it from x86 also we can drop both #ifdefs. Do
you see any drawback with that?

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


Re: [U-Boot] [PATCH 12/14] microblaze: Move architecture to use generic board init

2015-01-29 Thread Michal Simek
Hi Simon,

On 01/29/2015 03:15 AM, Simon Glass wrote:
> Hi Michal,
> 
> On 27 January 2015 at 08:20, Michal Simek  wrote:
>> Compile code with -fPIC to get GOT. Do not build SPL
>> with fPIC because it increasing SPL size for nothing.
>>
>> Signed-off-by: Michal Simek 
>> ---
>>

...

>> -#if defined(CONFIG_MIPS) || defined(CONFIG_PPC)
>> +#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || 
>> defined(CONFIG_MICROBLAZE)
>>  static int init_func_ram(void)
>>  {
> 
> Can you use dram_init() instead?

No problem will do it in v2.

Where dram_init(void) should be declared?
I see that others have it in arch header. Maybe better to have
it in any shared location.

>> --- a/common/board_r.c
>> +++ b/common/board_r.c
>> @@ -829,7 +829,7 @@ init_fnc_t init_sequence_r[] = {
>>  #if defined(CONFIG_ARM)
>> initr_enable_interrupts,
>>  #endif
>> -#ifdef CONFIG_X86
>> +#if defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE)
>> timer_init, /* initialize timer */
>>  #endif
> 
> Could you use interrupt_init() immediately before?

What do you mean by that?
Do you want to do timer_init in interrupt_init()?

Thanks,
Michal

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


Re: [U-Boot] [PATCH 0/3] arm: reduce .bss section clear time

2015-01-29 Thread Przemyslaw Marczak

Hello,

On 01/28/2015 01:55 PM, Przemyslaw Marczak wrote:

This patchset reduces the boot time for ARM architecture,
Exynos boards, and boards with DFU enabled(ARM).

For tested Trats2 device, this was done in three steps.

First was enable the arch memcpy and memset.
The second step was enable memset for .bss clear.
The third step for reduce this operation is to keep .bss section
small as possible.

The .bss section will grow if we have a lot of static variables.
This section is cleared before jump to the relocated U-Boot,
and it's done word by word. To reduce the time for this step,
we can enable arch memset, which uses multiple ARM registers.

For configs with DFU enabled, we can find the dfu buffer in this section,
which has at least 8MB (32MB for trats2). This is a lot of useless data,
which is not required for standard boot. So this buffer should be dynamic
allocated.

Przemyslaw Marczak (3):
   exynos: config: enable arch memcpy and arch memset
   arm: relocation: clear .bss section with arch memset if defined
   dfu: mmc: file buffer: remove static allocation

  arch/arm/lib/crt0.S | 10 +-
  drivers/dfu/dfu_mmc.c   | 25 ++---
  include/configs/exynos-common.h |  3 +++
  3 files changed, 34 insertions(+), 4 deletions(-)



So I made some additional tests with the oscilloscope.

Quick about the measurement:
The board is Odroid X2; Exynos4412(this one have gpio header).

Time is measured between change the state of one GPIo pin.

GPIO HI - set the gpio register in "reset" label in: 
arch/arm/cpu/armv7/start.S
GPIO LO - set gpio register with "bootcmd" with setting register by 
"mw.l ..."


${bootdelay}=0

odroid_defconfig  = .bss ~32.3MB

I tested few changes:
- 850ms - no changes:
- 840ms - + CONFIG_USE_ARCH_MEMCPY/MEMSET
- 540ms - .bss memset (patch 2)
- 210ms - dynamic allocation dfu file buf (patch 3)

And the next is interesting.
 odroid_defconfig has more than 80MB for malloc (we need about 64mb for 
the DFU now, to be able write 32MB file).


This is the CONFIG_SYS_MALLOC_LEN. And the memory area for malloc is set 
to 0 in function mem_malloc_init(). So for this config that function

sets more than 80MB to zero.

This is not good, because we shouldn't expect zeroed memory returned by 
malloc pointer. This is a job for calloc.


Especially if some command expects zeroed memory after malloc, probably 
after few next calls - it can crash...


For the testing purposes I changed the memset area in mem_malloc_init().
The CONFIG_SYS_MALLOC_LEN is unchanged, so the dfu can still alloc 2x32MB...

The results:
- 158ms - malloc memset len: 40MB
- 109ms - malloc memset len:  1MB

And a quick test for Trats2 with trace clock cycle counter:
- 333ms - malloc memset len:  1MB (for the standard config it was more 
than 1520ms)


The malloc memset can't be removed now, because it requires check/change 
to calloc a lot of calls, but the board can boot if I set this to 256K.


So the final improvement which could be achieved for the odroid config 
is 850ms -> 109 ms. This is about 8 times faster.


And the tested boards difference:
- Trats2 - 800MHz
- Odroid X2 - 1000MHz
- different BL1/BL2

Now I'm not so sure about the measurement reliability using the trace.

The Trats2 has no gpios header, and now I don't have time for the 
combinations.


So enable the DFU in the board config will increase the boot time.
But the real reason is that the malloc memory area is set to zero on boot.

I think, that we should follow the malloc/calloc/realloc differences 
like in this description: http://man7.org/linux/man-pages/man3/malloc.3.html


Now I go for some holidays, and probably I will be unreachable until 
9-th February. Sorry for troubles.


Best regards,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/13] lcd: dt: extract simplefb support

2015-01-29 Thread Stephen Warren

On 01/29/2015 04:21 AM, Nikita Kiryanov wrote:

We now have api functions that can support compiling simplefb code as its own
module. Since this code is not part of the display functionality, extract it
to its own file.

Raspberry Pi config file is updated to compile the new file.


I don't see any config file updates. I think one isn't needed, since the 
config file must already have CONFIG_LCD_DT_SIMPLEFB enabled, since the 
existing code is under that ifdef.


Acked-by: Stephen Warren 

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


Re: [U-Boot] [PATCH 1/2] fastboot: add "fastboot oem" command support

2015-01-29 Thread Marek Vasut
On Thursday, January 29, 2015 at 09:30:27 AM, Lukasz Majewski wrote:
> Hi Rob,

Hi all!

> > From: Michael Scott 
> > 
> > Add code stub to handle "fastboot oem __" command. As unlock is a
> > common fastboot command, distinguish that it is not implemented.
> > 
> > Signed-off-by: Michael Scott 
> > Signed-off-by: Rob Herring 
> > ---
> > 
> >  drivers/usb/gadget/f_fastboot.c | 15 +++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/drivers/usb/gadget/f_fastboot.c
> > b/drivers/usb/gadget/f_fastboot.c index 310175a..e2fda86 100644
> > --- a/drivers/usb/gadget/f_fastboot.c
> > +++ b/drivers/usb/gadget/f_fastboot.c
> > @@ -513,6 +513,17 @@ static void cb_flash(struct usb_ep *ep, struct
> > usb_request *req) }
> > 
> >  #endif
> > 
> > +static void cb_oem(struct usb_ep *ep, struct usb_request *req)
> > +{
> > +   char *cmd = req->buf;
> > +   if (strncmp("unlock", cmd + 4, 8) == 0) {
> > +   fastboot_tx_write_str("FAILnot implemented");
> > +   }
> > +   else {
> > +   fastboot_tx_write_str("FAILunknown oem command");
> > +   }
> 
> Just a minor comment - those braces could be removed.
> 
> BTW: Marek shall I take those patches to dfu tree or would you take
> them to -usb tree ?

Take them through DFU please, thank you!

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 v3 01/12] dm: i2c-uclass-compat: fix missed argument

2015-01-29 Thread Simon Glass
On 27 January 2015 at 08:38, Simon Glass  wrote:
> Hi Przemyslaw,
>
> On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
>> This patch fixes build error for CONFIG_DM_I2C_COMPAT.
>> In i2c_get_chip_for_busnum() call, one of argument was missed,
>> which was offset_len. Now it is set to 'alen' as previous.
>>
>> Signed-off-by: Przemyslaw Marczak 
>> ---
>>  drivers/i2c/i2c-uclass-compat.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/i2c-uclass-compat.c 
>> b/drivers/i2c/i2c-uclass-compat.c
>> index 11239da..841ce05 100644
>> --- a/drivers/i2c/i2c-uclass-compat.c
>> +++ b/drivers/i2c/i2c-uclass-compat.c
>> @@ -17,7 +17,7 @@ static int i2c_compat_get_device(uint chip_addr, int alen,
>> struct dm_i2c_chip *chip;
>> int ret;
>>
>> -   ret = i2c_get_chip_for_busnum(cur_busnum, chip_addr, devp);
>> +   ret = i2c_get_chip_for_busnum(cur_busnum, chip_addr, alen, devp);
>> if (ret)
>> return ret;
>> chip = dev_get_parent_platdata(*devp);
>> --
>
> Thanks. I sent a patch which fixes this too but have not yet applied it.
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/18] arndale: config: disable max77686 support

2015-01-29 Thread Simon Glass
On 26 January 2015 at 20:13, Simon Glass  wrote:
> On 8 January 2015 at 04:33, Przemyslaw Marczak  wrote:
>> There is no MAX77686 pmic on this board,
>> so the driver support should be removed.
>>
>> Signed-off-by: Przemyslaw Marczak 
>> Cc: Minkyu Kang 
>> ---
>>  include/configs/arndale.h | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/include/configs/arndale.h b/include/configs/arndale.h
>> index d68993b..3ad4a9b 100644
>> --- a/include/configs/arndale.h
>> +++ b/include/configs/arndale.h
>> @@ -51,8 +51,6 @@
>>  /* PMIC */
>>  #define CONFIG_PMIC
>>  #define CONFIG_POWER_I2C
>> -#define CONFIG_POWER_MAX77686
>> -
>>
>>  #define CONFIG_PREBOOT
>>
>> --
>> 1.9.1
>>
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 04/12] smdk5250: config: enable max77686 driver support

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> This commit enable support for the above driver,
> which was disabled in common config.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Simon Glass 
> Cc: Minkyu Kang 
> ---
>  include/configs/smdk5250.h | 2 ++
>  1 file changed, 2 insertions(+)
>

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 03/12] exynos5250: config: disable max77686 driver

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> This PMIC is not common for all Exynos5250
> based boards, so should be romoved from
> common config.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Simon Glass 
> Cc: Minkyu Kang 
> ---
>  include/configs/exynos5250-common.h | 3 ---
>  1 file changed, 3 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 07/12] exynos5: pinmux: check flag for i2c config

2015-01-29 Thread Simon Glass
On 27 January 2015 at 08:38, Simon Glass  wrote:
> On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
>> Some versions of Exynos5 supports High-Speed I2C,
>> on few interfaces, this change allows support this.
>> The new flag is: PINMUX_FLAG_HS_MODE
>>
>> Signed-off-by: Przemyslaw Marczak 
>> Cc: Simon Glass 
>> Cc: Akshay Saraswat 
>> Cc: Minkyu Kang 
>>
>> ---
>> Changes v3:
>> - add new flag: PINMUX_FLAG_HS_MODE
>> ---
>>  arch/arm/cpu/armv7/exynos/pinmux.c| 27 +++
>>  arch/arm/include/asm/arch-exynos/pinmux.h |  3 +++
>>  2 files changed, 22 insertions(+), 8 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 05/12] exynos4: dts: add missing i2c properties

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> This patch modify i2c nodes in exynos4.dtsi with:
> - adding proper interrupts arrays for each i2c node,
>   which allows to decode periph id
> - add reg address for each i2c node for i2c driver internal use
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Minkyu Kang 
> Cc: Lukasz Majewski 
> ---
>  arch/arm/dts/exynos4.dtsi | 24 
>  1 file changed, 16 insertions(+), 8 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 06/12] arndale: dts: add missing i2c aliases

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> Without this alias setting, the seq numbers
> of the i2c devices are wrong.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Simon Glass 
> Cc: Minkyu Kang 
> ---
>  arch/arm/dts/exynos5250-arndale.dts | 8 
>  1 file changed, 8 insertions(+)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 11/12] odroid u3: enable dm i2c support

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> This patch enables CONFIG_DM_I2C and also CONFIG_DM_I2C_COMPAT.
> The last one should be removed when the dm pmic framework will
> be finished.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Minkyu Kang 
>
> ---
> Changes v2:
> - new patch
> ---
>  board/samsung/odroid/odroid.c | 14 +-
>  include/configs/odroid.h  |  5 ++---
>  2 files changed, 3 insertions(+), 16 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 10/12] odroid u3: dts: add missing i2c aliases

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> This change fixes i2c bus numbering for Odroid U3.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Minkyu Kang 
>
> ---
> Changes v2:
> - new patch
> ---
>  arch/arm/dts/exynos4412-odroid.dts | 7 +++
>  1 file changed, 7 insertions(+)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/12] dm: i2c: s3c24x0: adjust to dm-i2c api

2015-01-29 Thread Simon Glass
On 27 January 2015 at 08:38, Simon Glass  wrote:
> On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
>> This commit adjusts the s3c24x0 driver to new i2c api
>> based on driver-model. The driver supports standard
>> and high-speed i2c as previous.
>>
>> Tested on Trats2, Odroid U3, Arndale, Odroid XU3
>>
>> Signed-off-by: Przemyslaw Marczak 
>> Tested-by: Simon Glass 
>> Cc: Simon Glass 
>> Cc: Heiko Schocher 
>> Cc: Minkyu Kang 
>
> Retested on snow.
>
> Acked-by: Simon Glass 

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/4] dm: exynos: dts: Set the offset length for cros_ec

2015-01-29 Thread Simon Glass
On 26 January 2015 at 20:29, Simon Glass  wrote:
> The EC has no concept of offset, so use a value of 0.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v4: None
>
>  arch/arm/dts/exynos5250-snow.dts | 1 +
>  1 file changed, 1 insertion(+)

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


Re: [U-Boot] [PATCH v4 1/4] dm: i2c: dts: Support an offset-len device tree property

2015-01-29 Thread Simon Glass
On 26 January 2015 at 20:29, Simon Glass  wrote:
> Since U-Boot can support different offset lengths (0-4 bytes), add a device
> tree property to specify this. This avoids hard-coding it in the driver.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v4: None
>
>  doc/device-tree-bindings/i2c/i2c.txt | 28 
>  drivers/i2c/i2c-uclass.c |  3 ++-
>  2 files changed, 30 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/i2c/i2c.txt

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


Re: [U-Boot] [PATCH v3 12/12] exynos5: enable dm i2c

2015-01-29 Thread Simon Glass
On 27 January 2015 at 05:36, Przemyslaw Marczak  wrote:
> This patch enables CONFIG_DM_I2C and also CONFIG_DM_I2C_COMPAT.
> The last one should be removed when all the i2c peripheral
> drivers will use dm i2c framework.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Simon Glass 
> Cc: Akshay Saraswat 
> Cc: Minkyu Kang 
> Cc: Simon Glass 
>
> ---
> Changes v2:
> - new patch
> ---
>  include/configs/exynos5-common.h | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 4/4] dm: cros_ec: Convert cros_ec_i2c over to driver model

2015-01-29 Thread Simon Glass
On 26 January 2015 at 20:29, Simon Glass  wrote:
> Move this driver to use driver model and update the snow configuration to
> match.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v4:
> - Add patches to support offset length in device tree
> - Rebase on top of exynos I2C series
>
>  drivers/misc/cros_ec_i2c.c | 82 
> --
>  include/configs/snow.h |  1 +
>  2 files changed, 30 insertions(+), 53 deletions(-)
>

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


Re: [U-Boot] [PATCH v4 3/4] dm: i2c: Add two more I2C init functions to the compatibility layer

2015-01-29 Thread Simon Glass
On 26 January 2015 at 20:29, Simon Glass  wrote:
> These functions are useful in case the board calls them. Also fix a missing
> parameter caused by applying the wrong patch (actually I failed to send v2
> and applied v1 by mistake).
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v4:
> - Bring in the correct patch version
>
>  drivers/i2c/i2c-uclass-compat.c | 16 +---
>  include/i2c.h   | 17 -
>  2 files changed, 29 insertions(+), 4 deletions(-)

(Rebased on Przemyslaw's later patch since it was part of a series)

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


Re: [U-Boot] [PATCH] arm, imx6, aristainetos: board updates

2015-01-29 Thread Stefano Babic
On 20/01/2015 10:06, Heiko Schocher wrote:
> - use linux display timing settings
> - change backlight duty cycle 500ns
> - some defaultenvironment changes
> - change fit_addr_r to 0x1400 as needed if
>   MAX_LOCKDEP_SUBCLASSES in linux gets increased.
> - Environment now at 0xd in nand flash
> 
> Signed-off-by: Heiko Schocher 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] Bug in buildman?

2015-01-29 Thread Simon Glass
Hi Andreas,

On 31 December 2014 at 05:44, Andreas Bießmann
 wrote:
> Hi Simon,
>
> while test-building 2015.01-rc4 I encountered following strange
> behaviour of buildman:
>
> ---8<---
> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
> -v avr32
> boards.cfg is up to date. Nothing to do.
> Building 1 commit for 10 boards (6 threads, 1 job per thread)
> Cloning repo for thread 0
> Cloning repo for thread 1
> Cloning repo for thread 2
> Cloning repo for thread 3
> Cloning repo for thread 4
> Cloning repo for thread 5
> 01: Prepare v2015.01-rc4
>  avr32: +   atstk1006
> 01: Prepare v2015.01-rc4
>  avr32: +   atngw100
> 01: Prepare v2015.01-rc4
>  avr32: +   favr-32-ezkit
> 01: Prepare v2015.01-rc4
>  avr32: +   atstk1004
> 01: Prepare v2015.01-rc4
>  avr32: +   hammerhead
> 01: Prepare v2015.01-rc4
>  avr32: +   grasshopper
> 01: Prepare v2015.01-rc4
>  avr32: +   atstk1003
> 01: Prepare v2015.01-rc4
>  avr32: +   atstk1002
> 01: Prepare v2015.01-rc4
>  avr32: +   mimc200
> 01: Prepare v2015.01-rc4
>  avr32: +   atngw100mkii
> 046 /10 0:00:02  : atngw100mkii
> ./tools/buildman/buildman -b buildtest -o /tmp/bar -v avr32  82.57s user
> 16.90s system 249% cpu 39.899 total
> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
> -v -lsed
> boards.cfg is up to date. Nothing to do.
> Summary of 1 commit for 1204 boards (6 threads, 1 job per thread)
> 01: Prepare v2015.01-rc4
>  avr32: +   atngw100mkii atstk1003 grasshopper favr-32-ezkit
> atstk1006 atstk1004 atstk1002 atngw100 hammerhead mimc200
> +(grasshopper,atngw100,favr-32-ezkit,atstk1006,atstk1004,hammerhead)
> Could not find linker script.
> +(grasshopper,atngw100,favr-32-ezkit,atstk1006,atstk1004,hammerhead)
> make[1]: *** [prepare1] Error 1
> +(grasshopper,atngw100,favr-32-ezkit,atstk1006,atstk1004,hammerhead)
> make: *** [sub-make] Error 2
> w+(atngw100mkii,atstk1002,atstk1003,mimc200) ../tools/kwbimage.c: In
> function ‘kwbimage_set_header’:
> w+(atngw100mkii,atstk1002,atstk1003,mimc200) ../tools/kwbimage.c:803:8:
> warning: ‘headersz’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
> -v -lsed grasshopper
> boards.cfg is up to date. Nothing to do.
> Summary of 1 commit for 1 boards (1 thread, 6 jobs per thread)
> 01: Prepare v2015.01-rc4
>  avr32: +   grasshopper
> +(grasshopper)   Could not find linker script.
> +(grasshopper) make[1]: *** [prepare1] Error 1
> +(grasshopper) make: *** [sub-make] Error 2
> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o
> /tmp/grasshopper -v grasshopper
> boards.cfg is up to date. Nothing to do.
> Building 1 commit for 1 boards (1 thread, 6 jobs per thread)
> Cloning repo for thread 0
> 01: Prepare v2015.01-rc4
>  avr32: +   grasshopper
> 010 /1  grasshopper
> ./tools/buildman/buildman -b buildtest -o /tmp/grasshopper -v
> grasshopper  14.11s user 2.69s system 183% cpu 9.171 total
> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o
> /tmp/grasshopper -v -lsed grasshopper
> boards.cfg is up to date. Nothing to do.
> Summary of 1 commit for 1 boards (1 thread, 6 jobs per thread)
> 01: Prepare v2015.01-rc4
>  avr32: +   grasshopper
> w+(grasshopper) ../tools/kwbimage.c: In function ‘kwbimage_set_header’:
> w+(grasshopper) ../tools/kwbimage.c:803:8: warning: ‘headersz’ may be
> used uninitialized in this function [-Wmaybe-uninitialized]
> --->8---
>
> buildman complains about missing linker script for most boards which is
> an error when building all avr32 boards. While it detects the correct
> warning for still not fixed kwbimage.c maybe-uninitialized when building
> just the single board which had an error before. Both builds are based
> on v2015.01-rc4 and built in different locations.

Sorry for not getting back sooner - twice I read your email and tried
to understand what is going on.

If a build already exists, buildman will not re-run it. Also the
output with -v is only provided for a build that actually happens. If
it happened in the last run, it won't be reported again.

The flow I use is:

buildman -b 

to do the build, then

buildman -b  -s

to see the errors and warnings, nicely sorted and collected.

The -v option is a convenience which shows output as things are built.

Does that have bearing on what you are seeing?

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


Re: [U-Boot] [PATCH 14/14] common: convert compulab splash load code to common code

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Move board/compulab/common/splash.c code to
> common/splash_source.c to make it available for everybody. This move
> renames cl_splash_screen_prepare() to splash_source_load(), and
> the compilation of this code is conditional on CONFIG_SPLASH_SOURCE.
> 
> splash_source features:
> * Provide a standardized way for declaring board specific splash screen
>   locations
> * Provide existing routines for auto loading the splash image from the
>   locations as declared by the board
> * Introduce the "splashsource" environment variable, which makes it
>   possible to select the splash image source.
> 
> cm-t35 and cm-fx6 are updated to use the modified version.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Tom Rini 
> Cc: Igor Grinberg 
> Cc: Anatolij Gustschin 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 13/14] arm: mx6: cm-fx6: add splash screen support

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Add support for splash screen.
> The splash screen is loaded from the SPI flash and is displayed on the
> HDMI display.
> 
> Signed-off-by: Nikita Kiryanov 
> [grinb...@compulab.co.il: minor code and commit message updates]
> Signed-off-by: Igor Grinberg 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 12/14] compulab: splash: support loading splash from sf

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Add support for loading splash from sf.
> 
> Signed-off-by: Nikita Kiryanov 
> [grinb...@compulab.co.il: staticize the sf global variable]
> Signed-off-by: Igor Grinberg 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 11/14] compulab: splash: support multiple splash sources

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Define a generic way for boards to define splash image locations:
> - introduce struct splash_location
> - introduce enum splash_storage
> - update cl_splash_screen_prepare() to take an array of above struct
>   and select the appropriate one based on the splashsource environment
>   variable (if it is not defined- use the first splash location as default).
> 
> cm-t35 is updated to work with the new interface.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 07/14] arm: mx6: cm-fx6: display compulab logo

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Add compulab logo and display it on boot.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 10/14] compulab: splash: refactor splash.c

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Move storage device specific code into its own function instead of
> calling it directly from an otherwise storage device independent
> function (cl_splash_screen_prepare).
> 
> This is a preparation for supporting multiple splash locations.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 08/14] arm: mx6: cm-fx6: add support for usb keyboard

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Add support for usb keyboard for cm_fx6.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 09/14] compulab: splash: use errno values

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Use errno values to improve return reporting.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 04/14] arm: mx6: cm-fx6: pass 2nd nic mac addr to Linux

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Obtain 2nd NIC MAC address from baseboard EEPROM and pass it to Linux.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 02/14] arm: mx6: cm-fx6: change dtb node for ethaddr

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> When passing eth address to Linux via dtb, the "local-mac-address"
> property should be set for "/soc/aips-bus@0210/ethernet@02188000",
> not "/fec".
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 06/14] arm: mx6: cm-fx6: add hdmi console support

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Add support for hdmi console.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 03/14] compulab: eeprom: allow reading mac address from multiple eeproms

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Implement the option to select the eeprom i2c bus when reading mac
> address.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> Cc: Ilya Ledvich 
> Cc: Dmitry Lifshitz 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 01/14] arm: mx6: cm-fx6: expand boot sequence

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Expand boot sequence to the following order:
> 1) mmc boot: mmc boot script, then mmc bootm, then mmc bootz.
> 2) usb boot: usb boot script.
> 3) sata boot: sata boot script, sata bootm, sata bootz.
> 4) nand boot: nand bootm, then nand bootz.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 05/14] arm: mx6: cm-fx6: increase size of malloc area

2015-01-29 Thread Stefano Babic
On 14/01/2015 09:42, Nikita Kiryanov wrote:
> Increase size of malloc area to make room for framebuffer
> and other such big allocations.
> 
> Signed-off-by: Nikita Kiryanov 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH v5 2/3] pmic:pfuze implement pmic_mode_init

2015-01-29 Thread Stefano Babic
On 27/01/2015 03:14, Peng Fan wrote:
> This patch is to implement pmic_mode_init function, and add prototype
> in header file.
> 
> This function is to set switching mode for pmic buck regulators to
> improve system efficiency.
> 
> Mode:
> OFF: The regulator is switched off and the output voltage is discharged.
> PFM: In this mode, the regulator is always in PFM mode, which
>  is useful at light loads for optimized efficiency.
> PWM: In this mode, the regulator is always in PWM mode operation
>  regardless of load conditions.
> APS: In this mode, the regulator moves automatically between
>  pulse skipping mode and PWM mode depending on load conditions.
> 
> Signed-off-by: Peng Fan 
> Acked-by: Przemyslaw Marczak 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH v5 1/3] pmic:pfuz100 add switch mode and more registers

2015-01-29 Thread Stefano Babic
On 27/01/2015 03:14, Peng Fan wrote:
> Add more pfuze register offset.
> And switch mode definition.
> Add a macro SWITCH_SIZE
> 
> Signed-off-by: Peng Fan 
> Acked-by: Przemyslaw Marczak 
> Reviewed-by: Stefano Babic 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH v5 3/3] imx:mx6 set normal APS and standby PFM mode

2015-01-29 Thread Stefano Babic
On 27/01/2015 03:14, Peng Fan wrote:
> To normal mode, use APS switching mode.
> To standy mode, use PFM switching mode.
> 
> Signed-off-by: Peng Fan 
> Acked-by: Przemyslaw Marczak 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH 1/4] mx6sx: pins: Enable SION for I2C3 iomux setting

2015-01-29 Thread Stefano Babic
Hi,

On 12/01/2015 11:37, Nikolay Dimitrov wrote:
> Hi Ye.Li,
> 
> On 01/12/2015 10:46 AM, Ye.Li wrote:
>> The I2C SDA and SCL require the IOMUX SION bit set to get input signal.
>>
>> Signed-off-by: Ye.Li 
>> ---
>>   arch/arm/include/asm/arch-mx6/mx6sx_pins.h |4 ++--
>>   1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/arch-mx6/mx6sx_pins.h
>> b/arch/arm/include/asm/arch-mx6/mx6sx_pins.h
>> index 7c6c1e8..da8c698 100644
>> --- a/arch/arm/include/asm/arch-mx6/mx6sx_pins.h
>> +++ b/arch/arm/include/asm/arch-mx6/mx6sx_pins.h
>> @@ -420,7 +420,7 @@ enum {
>>
>>MX6_PAD_KEY_COL4__KPP_COL_4=
>> IOMUX_PAD(0x03FC, 0x00B4, 0, 0x, 0, 0),
>>MX6_PAD_KEY_COL4__ENET2_MDC=
>> IOMUX_PAD(0x03FC, 0x00B4, 1, 0x, 0, 0),
>> - MX6_PAD_KEY_COL4__I2C3_SCL =
>> IOMUX_PAD(0x03FC, 0x00B4, 2, 0x07B8, 2, 0),
>> + MX6_PAD_KEY_COL4__I2C3_SCL =
>> IOMUX_PAD(0x03FC, 0x00B4, IOMUX_CONFIG_SION | 2, 0x07B8, 2, 0),
>>MX6_PAD_KEY_COL4__USDHC2_LCTL  =
>> IOMUX_PAD(0x03FC, 0x00B4, 3, 0x, 0, 0),
>>MX6_PAD_KEY_COL4__AUDMUX_AUD5_RXC  =
>> IOMUX_PAD(0x03FC, 0x00B4, 4, 0x0664, 0, 0),
>>MX6_PAD_KEY_COL4__GPIO2_IO_14  =
>> IOMUX_PAD(0x03FC, 0x00B4, 5, 0x, 0, 0),
>> @@ -467,7 +467,7 @@ enum {
>>
>>MX6_PAD_KEY_ROW4__KPP_ROW_4=
>> IOMUX_PAD(0x0410, 0x00C8, 0, 0x, 0, 0),
>>MX6_PAD_KEY_ROW4__ENET2_MDIO   =
>> IOMUX_PAD(0x0410, 0x00C8, 1, 0x0770, 3, 0),
>> - MX6_PAD_KEY_ROW4__I2C3_SDA =
>> IOMUX_PAD(0x0410, 0x00C8, 2, 0x07BC, 2, 0),
>> + MX6_PAD_KEY_ROW4__I2C3_SDA =
>> IOMUX_PAD(0x0410, 0x00C8, IOMUX_CONFIG_SION | 2, 0x07BC, 2, 0),
>>MX6_PAD_KEY_ROW4__USDHC1_LCTL  =
>> IOMUX_PAD(0x0410, 0x00C8, 3, 0x, 0, 0),
>>MX6_PAD_KEY_ROW4__AUDMUX_AUD5_RXFS =
>> IOMUX_PAD(0x0410, 0x00C8, 4, 0x0668, 0, 0),
>>MX6_PAD_KEY_ROW4__GPIO2_IO_19  =
>> IOMUX_PAD(0x0410, 0x00C8, 5, 0x, 0, 0),
>>
> 
> Usually the SCL is output-only, driven by the I2C master. Why do you
> need to enable SION bit on SCL, if the pin will be used as output-only?
> 

Right - I do not see why SION should be set.

Regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] Bug in buildman?

2015-01-29 Thread Andreas Bießmann
Hi Simon,

I add some more descriptive text.

On 29.01.15 18:41, Simon Glass wrote:
> Hi Andreas,
> 
> On 31 December 2014 at 05:44, Andreas Bießmann
>  wrote:
>> Hi Simon,
>>
>> while test-building 2015.01-rc4 I encountered following strange
>> behaviour of buildman:
>>
>> ---8<---

This time create non existing /tmp/bar and run the build for all avr32
boards on the last commit.

>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
>> -v avr32
>> boards.cfg is up to date. Nothing to do.
>> Building 1 commit for 10 boards (6 threads, 1 job per thread)

Ok, it starts 6 threads ...

>> 01: Prepare v2015.01-rc4
>>  avr32: +   atngw100mkii
>> 046 /10 0:00:02  : atngw100mkii

Ouch ... six errors, what's going on here? Let's print the errors and
summary ...

>> ./tools/buildman/buildman -b buildtest -o /tmp/bar -v avr32  82.57s user
>> 16.90s system 249% cpu 39.899 total
>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
>> -v -lsed

>> +(grasshopper,atngw100,favr-32-ezkit,atstk1006,atstk1004,hammerhead)
>> Could not find linker script.

>> w+(atngw100mkii,atstk1002,atstk1003,mimc200) ../tools/kwbimage.c:803:8:
>> warning: ‘headersz’ may be used uninitialized in this function
>> [-Wmaybe-uninitialized]

Oups some complains about missing linker script and something is wrong
with kwbimage  Let's see what's going on with grasshopper, I know
this builds fine, so let's see:

>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
>> -v -lsed grasshopper
>> boards.cfg is up to date. Nothing to do.
>> Summary of 1 commit for 1 boards (1 thread, 6 jobs per thread)
>> 01: Prepare v2015.01-rc4
>>  avr32: +   grasshopper
>> +(grasshopper)   Could not find linker script.
>> +(grasshopper) make[1]: *** [prepare1] Error 1
>> +(grasshopper) make: *** [sub-make] Error 2

Ok, missing linker script. That is wrong, I know grasshopper builds
fine! So run another build for just the grasshopper board with another
output directory (/tmp/grasshopper) ... thus a fresh build.

>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o
>> /tmp/grasshopper -v grasshopper
>> boards.cfg is up to date. Nothing to do.
>> Building 1 commit for 1 boards (1 thread, 6 jobs per thread)

Ok, this time it starts just one thread.

>> Cloning repo for thread 0
>> 01: Prepare v2015.01-rc4
>>  avr32: +   grasshopper
>> 010 /1  grasshopper

Yep, it builds fine (besides the warning) ...

>> ./tools/buildman/buildman -b buildtest -o /tmp/grasshopper -v
>> grasshopper  14.11s user 2.69s system 183% cpu 9.171 total
>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o
>> /tmp/grasshopper -v -lsed grasshopper
>> boards.cfg is up to date. Nothing to do.
>> Summary of 1 commit for 1 boards (1 thread, 6 jobs per thread)
>> 01: Prepare v2015.01-rc4
>>  avr32: +   grasshopper
>> w+(grasshopper) ../tools/kwbimage.c: In function ‘kwbimage_set_header’:
>> w+(grasshopper) ../tools/kwbimage.c:803:8: warning: ‘headersz’ may be
>> used uninitialized in this function [-Wmaybe-uninitialized]

Ok, the warning is about kwbimage.c. I know this warning and it will be
fixed soon.

So there must be something wrong when it builds more than one board at a
time. I guess it has something to do with the threads.

>> buildman complains about missing linker script for most boards which is
>> an error when building all avr32 boards. While it detects the correct
>> warning for still not fixed kwbimage.c maybe-uninitialized when building
>> just the single board which had an error before. Both builds are based
>> on v2015.01-rc4 and built in different locations.
> 
> Sorry for not getting back sooner - twice I read your email and tried
> to understand what is going on.

Sorry for being not clear with my error description. I hope the
additional thoughts may help.

This happens on current Debian stable (which has python 2.7.3-4+deb7u1)
but not with Debian testing (which has python 2.7.8-2) nor with my MAC
box (which has Python 2.7.9, thanks to macports).

Best regards

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


Re: [U-Boot] [PATCH v3] net: configure DWMAC DMA by default AXI burst length

2015-01-29 Thread Joe Hershberger
On Wed, Jan 28, 2015 at 11:37 PM, Sonic Zhang  wrote:
>
> From: Sonic Zhang 
>
> Board can define its own AXI burst length to improve DWMAC DMA
performance.
>
> v2-changes:
> - Avoid write burst len register when the Macro is not defined.
>
> v3-changes:
> - Add axi_bus register member to struct eth_dma_regs.
>
> Signed-off-by: Sonic Zhang 
> ---

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


Re: [U-Boot] Bug in buildman?

2015-01-29 Thread Simon Glass
+Masahiro

Hi Andreas,

On 29 January 2015 at 11:05, Andreas Bießmann
 wrote:
> Hi Simon,
>
> I add some more descriptive text.
>
> On 29.01.15 18:41, Simon Glass wrote:
>> Hi Andreas,
>>
>> On 31 December 2014 at 05:44, Andreas Bießmann
>>  wrote:
>>> Hi Simon,
>>>
>>> while test-building 2015.01-rc4 I encountered following strange
>>> behaviour of buildman:
>>>
>>> ---8<---
>
> This time create non existing /tmp/bar and run the build for all avr32
> boards on the last commit.
>
>>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
>>> -v avr32
>>> boards.cfg is up to date. Nothing to do.
>>> Building 1 commit for 10 boards (6 threads, 1 job per thread)
>
> Ok, it starts 6 threads ...
>
>>> 01: Prepare v2015.01-rc4
>>>  avr32: +   atngw100mkii
>>> 046 /10 0:00:02  : atngw100mkii
>
> Ouch ... six errors, what's going on here? Let's print the errors and
> summary ...
>
>>> ./tools/buildman/buildman -b buildtest -o /tmp/bar -v avr32  82.57s user
>>> 16.90s system 249% cpu 39.899 total
>>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
>>> -v -lsed
>
>>> +(grasshopper,atngw100,favr-32-ezkit,atstk1006,atstk1004,hammerhead)
>>> Could not find linker script.
>
>>> w+(atngw100mkii,atstk1002,atstk1003,mimc200) ../tools/kwbimage.c:803:8:
>>> warning: ‘headersz’ may be used uninitialized in this function
>>> [-Wmaybe-uninitialized]
>
> Oups some complains about missing linker script and something is wrong
> with kwbimage  Let's see what's going on with grasshopper, I know
> this builds fine, so let's see:
>
>>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o /tmp/bar
>>> -v -lsed grasshopper
>>> boards.cfg is up to date. Nothing to do.
>>> Summary of 1 commit for 1 boards (1 thread, 6 jobs per thread)
>>> 01: Prepare v2015.01-rc4
>>>  avr32: +   grasshopper
>>> +(grasshopper)   Could not find linker script.
>>> +(grasshopper) make[1]: *** [prepare1] Error 1
>>> +(grasshopper) make: *** [sub-make] Error 2
>
> Ok, missing linker script. That is wrong, I know grasshopper builds
> fine! So run another build for just the grasshopper board with another
> output directory (/tmp/grasshopper) ... thus a fresh build.
>
>>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o
>>> /tmp/grasshopper -v grasshopper
>>> boards.cfg is up to date. Nothing to do.
>>> Building 1 commit for 1 boards (1 thread, 6 jobs per thread)
>
> Ok, this time it starts just one thread.
>
>>> Cloning repo for thread 0
>>> 01: Prepare v2015.01-rc4
>>>  avr32: +   grasshopper
>>> 010 /1  grasshopper
>
> Yep, it builds fine (besides the warning) ...
>
>>> ./tools/buildman/buildman -b buildtest -o /tmp/grasshopper -v
>>> grasshopper  14.11s user 2.69s system 183% cpu 9.171 total
>>> andreas@andreas-pc % ./tools/buildman/buildman -b buildtest -o
>>> /tmp/grasshopper -v -lsed grasshopper
>>> boards.cfg is up to date. Nothing to do.
>>> Summary of 1 commit for 1 boards (1 thread, 6 jobs per thread)
>>> 01: Prepare v2015.01-rc4
>>>  avr32: +   grasshopper
>>> w+(grasshopper) ../tools/kwbimage.c: In function ‘kwbimage_set_header’:
>>> w+(grasshopper) ../tools/kwbimage.c:803:8: warning: ‘headersz’ may be
>>> used uninitialized in this function [-Wmaybe-uninitialized]
>
> Ok, the warning is about kwbimage.c. I know this warning and it will be
> fixed soon.
>
> So there must be something wrong when it builds more than one board at a
> time. I guess it has something to do with the threads.

Unless I am much-mistaken this is a Kbuild/Makefile problem rather
than anything to do with buildman. You can use -T to control the
number of threads.

>
>>> buildman complains about missing linker script for most boards which is
>>> an error when building all avr32 boards. While it detects the correct
>>> warning for still not fixed kwbimage.c maybe-uninitialized when building
>>> just the single board which had an error before. Both builds are based
>>> on v2015.01-rc4 and built in different locations.
>>
>> Sorry for not getting back sooner - twice I read your email and tried
>> to understand what is going on.
>
> Sorry for being not clear with my error description. I hope the
> additional thoughts may help.

Yes I understand now.

>
> This happens on current Debian stable (which has python 2.7.3-4+deb7u1)
> but not with Debian testing (which has python 2.7.8-2) nor with my MAC
> box (which has Python 2.7.9, thanks to macports).

I'm copying Masahiro, as I recall he fixed a problem something like
this recently.

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


[U-Boot] [PATCH 1/2] buildman: Fix incorrect arguemnt in GetUpstream()

2015-01-29 Thread Simon Glass
This causes an error when trying to build a local branch which has a local
branch as its upstream.

Signed-off-by: Simon Glass 
Reported-by: Masahiro Yamada 
---

 tools/patman/gitutil.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index cc5a55a..9a40f68 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -129,7 +129,7 @@ def GetUpstream(git_dir, branch):
 return upstream, msg
 
 if remote == '.':
-return merge
+return merge, None
 elif remote and merge:
 leaf = merge.split('/')[-1]
 return '%s/%s' % (remote, leaf), None
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH 2/2] patman: Read in the git-mailrc alias file

2015-01-29 Thread Simon Glass
We should read this file to obtain a set of aliases. This reduces the need
to create them in the ~/.patman file.

This feature did exist in some version of patman, and is mentioned in the
help but it did not find its way upstream.

Reported-by: Graeme Russ 
Signed-off-by: Simon Glass 
---

 tools/patman/settings.py | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 122e8fd..ba2a68f 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -235,6 +235,31 @@ def _UpdateDefaults(parser, config):
 else:
 print "WARNING: Unknown setting %s" % name
 
+def _ReadAliasFile(fname):
+"""Read in the U-Boot git alias file if it exists.
+
+Args:
+fname: Filename to read.
+"""
+if os.path.exists(fname):
+bad_line = None
+with open(fname) as fd:
+linenum = 0
+for line in fd:
+linenum += 1
+line = line.strip()
+if not line or line.startswith('#'):
+continue
+words = line.split(' ', 2)
+if len(words) < 3 or words[0] != 'alias':
+if not bad_line:
+bad_line = "%s:%d:Invalid line '%s'" % (fname, linenum,
+line)
+continue
+alias[words[1]] = [s.strip() for s in words[2].split(',')]
+if bad_line:
+print bad_line
+
 def Setup(parser, project_name, config_fname=''):
 """Set up the settings module by reading config files.
 
@@ -244,6 +269,8 @@ def Setup(parser, project_name, config_fname=''):
 for sections named "project_section" as well.
 config_fname:   Config filename to read ('' for default)
 """
+# First read the git alias file if available
+_ReadAliasFile('doc/git-mailrc')
 config = _ProjectConfigParser(project_name)
 if config_fname == '':
 config_fname = '%s/.patman' % os.getenv('HOME')
-- 
2.2.0.rc0.207.ga3a616c

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


Re: [U-Boot] [PATCH] fastboot: Add USB cable detect check

2015-01-29 Thread Steve Rae



On 15-01-26 01:14 PM, Rob Herring wrote:

Add a check for USB cable attached and only enter fastboot when a cable
is attached.

Signed-off-by: Rob Herring 
---
  common/cmd_fastboot.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index b72f4f3..346ab80 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -20,6 +20,12 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, 
char *const argv[])
if (ret)
return ret;

+   if (!g_dnl_board_usb_cable_connected()) {
+   puts("\rUSB cable not detected.\n" \
+"Command exit.\n");
+   return CMD_RET_FAILURE;
+   }
+
while (1) {
if (g_dnl_detach())
break;



(question: the leading "\r" ?!?!)

Reviewed-by: Steve Rae 

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


Re: [U-Boot] [PATCH 1/5] nand: Use common read function instead of verify_buf()

2015-01-29 Thread Scott Wood
On Tue, 2015-01-27 at 17:47 -0600, Peter Tyser wrote:
> Hi Scott,
> 
> 
> > > I waffled about removing it, but leaned towards leaving it in because:
> > > - I didn't want to change the existing U-Boot behavior for other
> > > users.  A google of 'u-boot "nand write"' shows a lot of examples that
> > > don't include verification of writes, and they should if we remove
> > > auto-verification.
> > 
> > How many configs actually enable this option?  I don't see many beyond
> > the FSL PPC boards (which are so full of copy-and-paste that it probably
> > wasn't deliberate).
> 
> Yeah, the majority are FSL 83xx and 85xx, with 2 or so random ARM boards.
> 
> > > - The reason it was removed in Linux was "Both UBI and JFFS2 are able
> > > to read verify what they wrote already.  There are also MTD tests
> > > which do this verification."  I thought U-Boot was more likely than
> > > Linux to use raw NAND writes without a filesystem, so leaving it in U-
> > > Boot made sense since the UBI/JFFS2 logic didn't apply as much here.
> > 
> > Right, though raw writes ought to be limited to blocks that aren't
> > written often enough to fail.
> > 
> > > - I didn't think a lot of people would know they have to explicitly
> > > verify NAND contents after a write, since they'd assume it was like
> > > other memories that aren't as lossy.
> > > 
> > > - The penalty of slightly different code from Linux and a small
> > > performance hit was worth the gain of auto-verification to me.  I
> > > viewed consolidating it into one small chunk of code as a happy medium.
> > 
> > The davinci patches show that there can still be driver dependencies
> > depending on what the driver overrides.  I'm not hugely opposed, but it
> > seems like it would be better to do it at a higher level (e.g. in
> > nand_util.c with a flag to enable, and either make support mandatory, or
> > if you try to use that command variant without support it fails rather
> > than silently not verifying).
> 
> That seems like a good idea.  How about:
> - Remove all CONFIG_MTD_NAND_VERIFY_WRITE references
> 
> - Add a new flag WITH_WR_VERIFY and have nand_write_skip_bad() in 
> nand_util.c verify writes only when it is set.
> 
> - Update the calls to nand_write_skip_bad() in cmd_nand.c to include
> the new WITH_WR_VERIFY flag.  I'd vote to enable it for all boards,
> but let me know if you disagree.
> 
> That would make all "nand write" commands verify writes, with the
> exception of "nand write.raw".  Any opinion on if this should also
> be verified?  I only use it for development/testing, so don't have
> a strong opinion.

"raw" refers to the absence of ECC, and I'd rather not overload it to
mean "don't verify".  Should it also be possible to request non-raw
non-verified accesses?  Or should we always verify and wait until
someone complains about performance?

What about DFU and other non-cmd_nand NAND accesses?

-Scott


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


[U-Boot] [PATCH v2 02/11] avr32: rename cpu_init() -> arch_cpu_init()

2015-01-29 Thread Andreas Bießmann
Signed-off-by: Andreas Bießmann 
---

Changes in v2: None
Changes in v1: None

 arch/avr32/cpu/cpu.c|2 +-
 arch/avr32/include/asm/u-boot.h |2 ++
 arch/avr32/lib/board.c  |2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/avr32/cpu/cpu.c b/arch/avr32/cpu/cpu.c
index cef630e..cd226a6 100644
--- a/arch/avr32/cpu/cpu.c
+++ b/arch/avr32/cpu/cpu.c
@@ -27,7 +27,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int cpu_init(void)
+int arch_cpu_init(void)
 {
extern void _evba(void);
 
diff --git a/arch/avr32/include/asm/u-boot.h b/arch/avr32/include/asm/u-boot.h
index 6aef808..2387f8a 100644
--- a/arch/avr32/include/asm/u-boot.h
+++ b/arch/avr32/include/asm/u-boot.h
@@ -25,4 +25,6 @@ typedef struct bd_info {
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_AVR32
 
+int arch_cpu_init(void);
+
 #endif /* __ASM_U_BOOT_H__ */
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 7d13ac5..95f9526 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -98,7 +98,7 @@ void board_init_f(ulong board_type)
 
/* Perform initialization sequence */
board_early_init_f();
-   cpu_init();
+   arch_cpu_init();
board_postclk_init();
env_init();
init_baudrate();
-- 
1.7.10.4

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


  1   2   >