Re: [U-Boot] [RFC PATCH V2] imx: add multi-BOM README

2013-11-10 Thread Wolfgang Denk
Dear Eric Nelson,

In message 1384037510-12154-1-git-send-email-eric.nel...@boundarydevices.com 
you wrote:
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 ---
 V2 replaces the words arch and architecture, since we're talking about
 processor variations within a family, not different processor architectures.

Assumin BOM means Bill of Materials, I still think that the Subject
is not really to the point.  This document describes only the
situation when replacing the iMX6 processor by another model of the
same family, not more.

Actually you write this yourself in the document:

 +This file describes how to support multiple variants of the iMX6 CPU 
 +(i.MX6DQ and i.MX6DLS) in a single U-Boot image.

I think instead of inventing a new name that does not really match
the description, we should just write that, i. e. something like
Add iMX6 family support README or Add iMX6 interchangeability
README or something like that.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
   - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/8] Provide a mechanism to avoid using #ifdef everywhere

2013-11-10 Thread Wolfgang Denk
Dear Simon,

In message capnjgz3b4szi_2h2sw7oop932ccgou8ho5e_fkmjcyv4ws+...@mail.gmail.com 
you wrote:

...
  By chance I ran about include/linux/kconfig.h in the Linux kernel
  tree, which provides (among other things) the IS_ENABLED() macro that
  implements essentially the very same feature.  Using this, the same
  code would be written as:
 
  if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
  setenv(ver, version_string);  /* set version variable */
...

 Fair enough, sounds reasonable. The relevant kernel code is quite unusual...

Indeed, this code is really a bit creepy...

 Many of U-Boot's options are not just yes/no, so I'm not sure what will
 happen with those. Perhaps they just can't be used with this macro? Part of
 my intent was to allow any option to be used.

I see.  Um... But then, I think the usage of the macro is somewhat
dangerous anyway.

 So for example you can do this:
 
 struct {
  const char *str;
  u_int len;
  int retry;
  const char *conf; /* Configuration value */
  }
  delaykey [] = {
  { str: getenv(bootdelaykey),  retry: 1,
  conf: autoconf_autoboot_delay_str() },
  { str: getenv(bootdelaykey2), retry: 1,
  conf: autoconf_autoboot_delay_str2() },
  { str: getenv(bootstopkey),   retry: 0,
  conf: autoconf_autoboot_stop_str() },
  { str: getenv(bootstopkey2),  retry: 0,
  conf: autoconf_autoboot_stop_str2() },
  };

Well, this is not exactly easy to read either.

 or this:
 
 /* don't retry auto boot? */
  if (autoconf_boot_retry_time() 
  !delaykey[i].retry)
  retry_time = -1;
 
 Note that autoconf_boot_retry_time() will return 0 if the CONFIG is not
 defined, or if its value is 0.

I see what yo mean, but I'd rather clean up the code to avoid such
ambiguities.

 It seems to me we should provide the Linux feature in U-Boot as part of the
 Kconfig stuff, and see where it takes us. Combined with a bit more
 rationalisation of things like main.c it might be enough.

Sounds like a plan - but we don't have to wait; we can add the header
file any time we ike, and start converting pieces of code that seem to
deserve such treatment.  And, probably even more interesting, we can
request it to be used for any new code being added.

 I like the simplicity and power of the autoconf feature, but I have similar
 reservations to others.

I understand you.  Eventuyally ther eis no easy solution that
satisfies all.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Dealing with failure is easy: work hard to improve. Success  is  also
easy  to  handle:  you've  solved  the  wrong  problem.  Work hard to
improve.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] gpio_led: check gpio_request() return value

2013-11-10 Thread Igor Grinberg
On 11/08/13 01:03, Igor Grinberg wrote:
 Add a check for the gpio_request() function return value and do not try
 to configure the GPIO if the gpio_request() call fails.
 Also, print an error message indicating the gpio_request() has failed.
 
 Signed-off-by: Igor Grinberg grinb...@compulab.co.il

Tested-by: Ilya Ledvich i...@compulab.co.il

 ---
  drivers/misc/gpio_led.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
 index 3fedddc..de20419 100644
 --- a/drivers/misc/gpio_led.c
 +++ b/drivers/misc/gpio_led.c
 @@ -11,7 +11,11 @@
  
  void __led_init(led_id_t mask, int state)
  {
 - gpio_request(mask, gpio_led);
 + if (gpio_request(mask, gpio_led) != 0) {
 + printf(%s: failed requesting GPIO%lu!\n, __func__, mask);
 + return;
 + }
 +
   gpio_direction_output(mask, state == STATUS_LED_ON);
  }
  
 

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


Re: [U-Boot] [PATCH 3/3] gpio_led: add support for inverted polarity

2013-11-10 Thread Igor Grinberg


On 11/08/13 01:03, Igor Grinberg wrote:
 Some GPIO connected LEDs have inverted polarity.
 Introduce new config option: CONFIG_GPIO_LED_INVERTED_TABLE for the
 specifying the inverted GPIO LEDs list and add support for this in the
 gpio_led driver.
 
 Signed-off-by: Igor Grinberg grinb...@compulab.co.il

Tested-by: Ilya Ledvich i...@compulab.co.il

on cm-t335.

 ---
  README  |  7 +++
  drivers/misc/gpio_led.c | 27 +--
  2 files changed, 32 insertions(+), 2 deletions(-)
 
 diff --git a/README b/README
 index 55c71fa..b8bad51 100644
 --- a/README
 +++ b/README
 @@ -1959,6 +1959,13 @@ CBFS (Coreboot Filesystem) support
   status LED backend implementation. Define CONFIG_GPIO_LED
   to include the gpio_led driver in the U-Boot binary.
  
 + CONFIG_GPIO_LED_INVERTED_TABLE
 + Some GPIO connected LEDs may have inverted polarity in which
 + case the GPIO high value corresponds to LED off state and
 + GPIO low value corresponds to LED on state.
 + In such cases CONFIG_GPIO_LED_INVERTED_TABLE may be defined
 + with a list of GPIO LEDs that have inverted polarity.
 +
  - CAN Support:   CONFIG_CAN_DRIVER
  
   Defining CONFIG_CAN_DRIVER enables CAN driver support
 diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
 index de20419..3e95727 100644
 --- a/drivers/misc/gpio_led.c
 +++ b/drivers/misc/gpio_led.c
 @@ -9,19 +9,42 @@
  #include status_led.h
  #include asm/gpio.h
  
 +#ifndef CONFIG_GPIO_LED_INVERTED_TABLE
 +#define CONFIG_GPIO_LED_INVERTED_TABLE {}
 +#endif
 +
 +static led_id_t gpio_led_inv[] = CONFIG_GPIO_LED_INVERTED_TABLE;
 +
 +static int gpio_led_gpio_value(led_id_t mask, int state)
 +{
 + int i, gpio_value = (state == STATUS_LED_ON);
 +
 + for (i = 0; i  ARRAY_SIZE(gpio_led_inv); i++) {
 + if (gpio_led_inv[i] == mask)
 + gpio_value = !gpio_value;
 + }
 +
 + return gpio_value;
 +}
 +
  void __led_init(led_id_t mask, int state)
  {
 + int gpio_value;
 +
   if (gpio_request(mask, gpio_led) != 0) {
   printf(%s: failed requesting GPIO%lu!\n, __func__, mask);
   return;
   }
  
 - gpio_direction_output(mask, state == STATUS_LED_ON);
 + gpio_value = gpio_led_gpio_value(mask, state);
 + gpio_direction_output(mask, gpio_value);
  }
  
  void __led_set(led_id_t mask, int state)
  {
 - gpio_set_value(mask, state == STATUS_LED_ON);
 + int gpio_value = gpio_led_gpio_value(mask, state);
 +
 + gpio_set_value(mask, gpio_value);
  }
  
  void __led_toggle(led_id_t mask)
 

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


[U-Boot] [PATCH 0/32] Add additional sandbox features and infrastructure

2013-11-10 Thread Simon Glass
At present sandbox only supports a basic set of features. To help address
this, a recent series added SPI and SPI flash support; this series expands
the coverage further.

Firstly SDL is used to provide LCD and audio support. Sandbox gains its own
LCD driver which can display images, host a command line, etc. The audio
support is basic and needs additional work, but it is a starting point.
SDL also provides a keyboard emulation (using the Chrome OS EC code as a
base).

Secondly a TPM emulation is added. This does not include all features (the
implementation is quite simplistic) but it is enough to do basic secure
boot operations.

Finally, various pieces of useful infrastructure are adding, including:

- loading and saving of the emulated SDRAM to permit test runs to carry
over state
- loading and saving of general sandbox state (for example a driver can
save its stage and reload it on the next run)
- support for using bootm to load a kernel
- providing a device tree for use by sandbox
- block device emulation using host files
- a means to jump to another U-Boot while preserving state (useful for
test environments which want to run a series of tests with
script-selectable state)
- allowing the console to be active on start-up so that errors are not
silent supressed

The block device emulation provides access to filesystems from sandbox
which should make it possible to write comprehensive filesystem tests.

Major functions which still remain without sandbox support are I2C,
networking and USB.


Che-Liang Chiou (1):
  sandbox: tpm: Fix nvwrite command

Henrik Nordström (1):
  sandbox: block driver using host file/device as backing store

Simon Glass (29):
  Add crc8 routine
  sandbox: Use system headers first for sandbox's os.c
  sandbox: Use uint64_t instead of u64 for time
  sandbox: Increase memory size to 32MB
  sandbox: spi: Adjust 'sf test' to work on sandbox
  sandbox: Build a device tree file for sandbox
  sandbox: config: Don't use 64-bit physical memory
  sandbox: Correct data sizes and printf() strings in fdtdec.c
  sandbox: Use os functions to read host device tree
  sandbox: Improve/augment memory allocation functions
  sandbox: Correct help message arg garbling
  sandbox: Allow return from board_init_f()
  sandbox: Implement the bootm command for sandbox
  sandbox: Allow the console to work earlier
  sandbox: Add -i option to enter interactive mode
  sandbox: Allow reading/writing of RAM buffer
  sandbox: Add facility to save/restore sandbox state
  sandbox: tpm: Add TPM emulation
  sandbox: dts: Add display and keyboard to sandbox
  sandbox: Add a prototype for cleanup_before_linux()
  cros_ec: Add an enum for the number of flash regions
  fdt: Add a function for reading a flash map entry
  cros_ec: Add a function for decoding the Chrome OS EC flashmap
  cros_ec: sandbox: Add Chrome OS EC emulation
  sandbox: Add os_jump_to_image() to run another executable
  sandbox: Add -j option to indicate a jump from a previous U-Boot
  sandbox: Add SDL library for LCD, keyboard, audio
  sandbox: Add a simple sound driver
  sandbox: Add LCD driver

Vadim Bendebury (1):
  cros_ec: Move EC interface into common library

 Makefile  |   1 +
 arch/sandbox/config.mk|   7 +
 arch/sandbox/cpu/Makefile |  12 +-
 arch/sandbox/cpu/cpu.c|  21 +-
 arch/sandbox/cpu/os.c | 187 -
 arch/sandbox/cpu/sdl.c| 334 +++
 arch/sandbox/cpu/start.c  | 121 +-
 arch/sandbox/cpu/state.c  | 353 
 arch/sandbox/include/asm/arch-sandbox/sound.h |  14 +
 arch/sandbox/include/asm/global_data.h|   2 +-
 arch/sandbox/include/asm/sdl.h|  20 +
 arch/sandbox/include/asm/state.h  | 132 +-
 arch/sandbox/include/asm/types.h  |   4 +-
 arch/sandbox/include/asm/u-boot-sandbox.h |   5 +
 board/samsung/smdk5250/exynos5-dt.c   |   5 -
 board/sandbox/dts/sandbox.dts |  91 +
 board/sandbox/sandbox/sandbox.c   |  19 +-
 common/Makefile   |   1 +
 common/board_f.c  |  63 ++-
 common/cmd_sandbox.c  |  64 +++
 common/cmd_sf.c   |  14 +-
 common/console.c  |  16 +-
 common/cros_ec.c  |  44 ++
 common/lcd.c  |  21 +-
 config.mk |   9 +-
 disk/part.c   |  23 +-
 doc/device-tree-bindings/video/sandbox-fb.txt |  13 +
 drivers/block/Makefile|   1 +
 drivers/block/sandbox.c   | 124 ++
 drivers/misc/Makefile |   1 +
 drivers/misc/cros_ec.c|  50 +++
 drivers/misc/cros_ec_sandbox.c

[U-Boot] [PATCH 01/32] Add crc8 routine

2013-11-10 Thread Simon Glass
Add an implementation of the CRC8 algorithm. This is required by the TPM
emulation, but is probably useful to U-Boot in general.

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

Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
---
 include/linux/crc8.h | 23 +++
 lib/Makefile |  1 +
 lib/crc8.c   | 25 +
 3 files changed, 49 insertions(+)
 create mode 100644 include/linux/crc8.h
 create mode 100644 lib/crc8.c

diff --git a/include/linux/crc8.h b/include/linux/crc8.h
new file mode 100644
index 000..b5fd2ac
--- /dev/null
+++ b/include/linux/crc8.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+
+#ifndef __linux_crc8_h
+#define __linux_crc8_h
+
+/**
+ * crc8() - Calculate and return CRC-8 of the data
+ *
+ * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would
+ * be faster, but for only a few bytes it isn't worth the code size
+ *
+ * @vptr: Buffer to checksum
+ * @len: Length of buffer in bytes
+ * @return CRC8 checksum
+ */
+unsigned int crc8(const unsigned char *vptr, int len);
+
+#endif
diff --git a/lib/Makefile b/lib/Makefile
index 4e3b500..bb9fcbf 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_BZIP2) += bzlib_randtable.o
 obj-$(CONFIG_BZIP2) += bzlib_huffman.o
 obj-$(CONFIG_USB_TTY) += circbuf.o
 obj-y += crc7.o
+obj-y += crc8.o
 obj-y += crc16.o
 obj-$(CONFIG_OF_CONTROL) += fdtdec.o
 obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
diff --git a/lib/crc8.c b/lib/crc8.c
new file mode 100644
index 000..8b68a29
--- /dev/null
+++ b/lib/crc8.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include linux/crc8.h
+
+unsigned int crc8(const unsigned char *vptr, int len)
+{
+   const unsigned char *data = vptr;
+   unsigned int crc = 0;
+   int i, j;
+
+   for (j = len; j; j--, data++) {
+   crc ^= (*data  8);
+   for (i = 8; i; i--) {
+   if (crc  0x8000)
+   crc ^= (0x1070  3);
+   crc = 1;
+   }
+   }
+
+   return (crc  8)  0xff;
+}
-- 
1.8.4.1

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


[U-Boot] [PATCH 05/32] sandbox: spi: Adjust 'sf test' to work on sandbox

2013-11-10 Thread Simon Glass
Add map_sysmem() calls so that this test works correctly on sandbox.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Hung-ying Tyan ty...@chromium.org
---
 common/cmd_sf.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 3994b06..b4ceb71 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -358,7 +358,8 @@ static void show_time(struct test_info *test, int stage)
int bps;/* Bits per second */
 
speed = (long long)test-bytes * 1000;
-   do_div(speed, test-time_ms[stage] * 1024);
+   if (test-time_ms[stage])
+   do_div(speed, test-time_ms[stage] * 1024);
bps = speed * 8;
 
printf(%d %s: %d ticks, %d KiB/s %d.%03d Mbps\n, stage,
@@ -446,11 +447,13 @@ static int do_spi_flash_test(int argc, char * const 
argv[])
 {
unsigned long offset;
unsigned long len;
-   uint8_t *buf = (uint8_t *)CONFIG_SYS_TEXT_BASE;
+   uint8_t *buf, *from;
char *endp;
uint8_t *vbuf;
int ret;
 
+   if (argc  3)
+   return -1;
offset = simple_strtoul(argv[1], endp, 16);
if (*argv[1] == 0 || *endp != 0)
return -1;
@@ -460,17 +463,18 @@ static int do_spi_flash_test(int argc, char * const 
argv[])
 
vbuf = malloc(len);
if (!vbuf) {
-   printf(Cannot allocate memory\n);
+   printf(Cannot allocate memory (%lu bytes)\n, len);
return 1;
}
buf = malloc(len);
if (!buf) {
free(vbuf);
-   printf(Cannot allocate memory\n);
+   printf(Cannot allocate memory (%lu bytes)\n, len);
return 1;
}
 
-   memcpy(buf, (char *)CONFIG_SYS_TEXT_BASE, len);
+   from = map_sysmem(CONFIG_SYS_TEXT_BASE, 0);
+   memcpy(buf, from, len);
ret = spi_flash_test(flash, buf, len, offset, vbuf);
free(vbuf);
free(buf);
-- 
1.8.4.1

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


[U-Boot] [PATCH 07/32] sandbox: config: Don't use 64-bit physical memory

2013-11-10 Thread Simon Glass
Sandbox uses an emulated memory map which is quite small. We don't need the
CONFIG_PHYS_64BIT option since we can address memory with a 32-bit offset
into our ram_buf.

Adjust the phys_addr_t and phys_size_t types accordingly.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Hung-ying Tyan ty...@chromium.org
---
 arch/sandbox/include/asm/types.h | 4 ++--
 include/configs/sandbox.h| 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h
index 88c84ba..6d3eb1f 100644
--- a/arch/sandbox/include/asm/types.h
+++ b/arch/sandbox/include/asm/types.h
@@ -48,8 +48,8 @@ typedef unsigned long long u64;
 #define BITS_PER_LONG  CONFIG_SANDBOX_BITS_PER_LONG
 
 typedef unsigned long dma_addr_t;
-typedef unsigned long phys_addr_t;
-typedef unsigned long phys_size_t;
+typedef u32 phys_addr_t;
+typedef u32 phys_size_t;
 
 #endif /* __KERNEL__ */
 
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 850a216..5c175d5 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -86,7 +86,6 @@
 #define CONFIG_SYS_LOAD_ADDR   0x
 #define CONFIG_SYS_MEMTEST_START   0x0010
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x1000)
-#define CONFIG_PHYS_64BIT
 #define CONFIG_SYS_FDT_LOAD_ADDR   0x100
 
 /* Size of our emulated memory */
-- 
1.8.4.1

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


[U-Boot] [PATCH 06/32] sandbox: Build a device tree file for sandbox

2013-11-10 Thread Simon Glass
Add support for building a device tree for sandbox's CONFIG_OF_HOSTFILE
option to make it easier to use device tree with sandbox.

This adjusts the Makefile to build a u-boot.dtb file which can be passed
to sandbox U-Boot with:

   ./u-boot -d u-boot.dtb

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Che-Liang Chiou clch...@chromium.org
Reviewed-by: Gabe Black gabebl...@chromium.org
---
 Makefile  |  1 +
 arch/sandbox/config.mk|  2 ++
 board/sandbox/dts/sandbox.dts | 29 +
 include/configs/sandbox.h |  1 +
 4 files changed, 33 insertions(+)
 create mode 100644 board/sandbox/dts/sandbox.dts

diff --git a/Makefile b/Makefile
index 1f499c5..1b1724c 100644
--- a/Makefile
+++ b/Makefile
@@ -365,6 +365,7 @@ ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.img
 ALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
+ALL-$(CONFIG_OF_HOSTFILE) += $(obj)u-boot.dtb
 ifneq ($(CONFIG_SPL_TARGET),)
 ALL-$(CONFIG_SPL) += $(obj)$(subst ,,$(CONFIG_SPL_TARGET))
 endif
diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index 6142dd4..60b7262 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -7,3 +7,5 @@ PLATFORM_LIBS += -lrt
 
 # Support generic board on sandbox
 __HAVE_ARCH_GENERIC_BOARD := y
+
+CONFIG_ARCH_DEVICE_TREE := sandbox
diff --git a/board/sandbox/dts/sandbox.dts b/board/sandbox/dts/sandbox.dts
new file mode 100644
index 000..9d7700c
--- /dev/null
+++ b/board/sandbox/dts/sandbox.dts
@@ -0,0 +1,29 @@
+/dts-v1/;
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+
+   model = Sandbox test environment;
+
+   memory {
+   reg = 0 0x0800;
+   };
+
+   triangle {
+   compatible = demo-shape;
+   colour = cyan;
+   sides = 3;
+   character = 83;
+   };
+   square {
+   compatible = demo-shape;
+   colour = blue;
+   sides = 4;
+   };
+   hexagon {
+   compatible = demo-simple;
+   colour = white;
+   sides = 6;
+   };
+};
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 3444c22..850a216 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -32,6 +32,7 @@
 #define CONFIG_FIT_SIGNATURE
 #define CONFIG_RSA
 #define CONFIG_CMD_FDT
+#define CONFIG_DEFAULT_DEVICE_TREE sandbox
 
 #define CONFIG_FS_FAT
 #define CONFIG_FS_EXT4
-- 
1.8.4.1

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


[U-Boot] [PATCH 23/32] cros_ec: Add an enum for the number of flash regions

2013-11-10 Thread Simon Glass
Add an enum for the number of flash regions so we can keep track of all
the possible regions.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Randall Spangler rspang...@chromium.org
---
 include/ec_commands.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/ec_commands.h b/include/ec_commands.h
index 12811cc..d9c8c1f 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -536,7 +536,7 @@ struct ec_response_flash_protect {
 
 enum ec_flash_region {
/* Region which holds read-only EC image */
-   EC_FLASH_REGION_RO,
+   EC_FLASH_REGION_RO = 0,
/* Region which holds rewritable EC image */
EC_FLASH_REGION_RW,
/*
@@ -544,6 +544,8 @@ enum ec_flash_region {
 * EC_FLASH_REGION_RO)
 */
EC_FLASH_REGION_WP_RO,
+   /* Number of regions */
+   EC_FLASH_REGION_COUNT,
 };
 
 struct ec_params_flash_region_info {
-- 
1.8.4.1

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


[U-Boot] [PATCH 28/32] sandbox: Add os_jump_to_image() to run another executable

2013-11-10 Thread Simon Glass
For some tests it is useful to be able to run U-Boot again but pass on the
same memory contents. Add a function to achieve this.

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

Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/os.c | 89 +++
 include/os.h  | 19 +++
 2 files changed, 108 insertions(+)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 725b505..d811f74 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -438,3 +438,92 @@ int os_read_ram_buf(const char *fname)
 
return 0;
 }
+
+static int make_exec(char *fname, const void *data, int size)
+{
+   int fd;
+
+   strcpy(fname, /tmp/u-boot.jump.XX);
+   fd = mkstemp(fname);
+   if (fd  0)
+   return -ENOENT;
+   if (write(fd, data, size)  0)
+   return -EIO;
+   close(fd);
+   if (chmod(fname, 0777))
+   return -ENOEXEC;
+
+   return 0;
+}
+
+static int add_args(char ***argvp, const char *add_args[], int count)
+{
+   char **argv;
+   int argc;
+
+   for (argv = *argvp, argc = 0; (*argvp)[argc]; argc++)
+   ;
+
+   argv = malloc((argc + count + 1) * sizeof(char *));
+   if (!argv) {
+   printf(Out of memory for %d argv\n, count);
+   return -ENOMEM;
+   }
+   memcpy(argv, *argvp, argc * sizeof(char *));
+   memcpy(argv + argc, add_args, count * sizeof(char *));
+   argv[argc + count] = NULL;
+
+   *argvp = argv;
+   return 0;
+}
+
+int os_jump_to_image(const void *dest, int size)
+{
+   struct sandbox_state *state = state_get_current();
+   char fname[30], mem_fname[30];
+   int fd, err;
+   const char *extra_args[4];
+   char **argv = state-argv;
+#ifdef DEBUG
+   int argc, i;
+#endif
+
+   err = make_exec(fname, dest, size);
+   if (err)
+   return err;
+
+   strcpy(mem_fname, /tmp/u-boot.mem.XX);
+   fd = mkstemp(mem_fname);
+   if (fd  0)
+   return -ENOENT;
+   close(fd);
+   err = os_write_ram_buf(mem_fname);
+   if (err)
+   return err;
+
+   os_fd_restore();
+
+   extra_args[0] = -j;
+   extra_args[1] = fname;
+   extra_args[2] = -m;
+   extra_args[3] = mem_fname;
+   err = add_args(argv, extra_args,
+  sizeof(extra_args) / sizeof(extra_args[0]));
+   if (err)
+   return err;
+
+#ifdef DEBUG
+   for (i = 0; argv[i]; i++)
+   printf(%d %s\n, i, argv[i]);
+#endif
+
+   if (state_uninit())
+   os_exit(2);
+
+   err = execv(fname, argv);
+   free(argv);
+   if (err)
+   return err;
+
+   return unlink(fname);
+}
diff --git a/include/os.h b/include/os.h
index b65fba4..8039e93 100644
--- a/include/os.h
+++ b/include/os.h
@@ -245,4 +245,23 @@ int os_write_ram_buf(const char *fname);
  */
 int os_read_ram_buf(const char *fname);
 
+/**
+ * Jump to a new executable image
+ *
+ * This uses exec() to run a new executable image, after putting it in a
+ * temporary file. The same arguments and environment are passed to this
+ * new image, with the addition of:
+ *
+ * -j filename   Specifies the filename the image was written to. The
+ * calling image may want to delete this at some point.
+ * -m filename   Specifies the file containing the sandbox memory
+ * (ram_buf) from this image, so that the new image can
+ * have access to this. It also means that the original
+ * memory filename passed to U-Boot will be left intact.
+ *
+ * @param dest Buffer containing executable image
+ * @param size Size of buffer
+ */
+int os_jump_to_image(const void *dest, int size);
+
 #endif
-- 
1.8.4.1

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


[U-Boot] [PATCH 29/32] sandbox: Add -j option to indicate a jump from a previous U-Boot

2013-11-10 Thread Simon Glass
In order to support the 'go' command we allow the jumping U-Boot to pass its
filename to the new U-Boot image. This can then be used to delete that image
if required.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
Tested-by: Che-Liang Chiou clch...@chromium.org
---
 arch/sandbox/cpu/start.c | 16 
 arch/sandbox/include/asm/state.h |  3 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 1df21d4..2d19fe7 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -107,6 +107,22 @@ static int sandbox_cmdline_cb_interactive(struct 
sandbox_state *state,
 
 SANDBOX_CMDLINE_OPT_SHORT(interactive, 'i', 0, Enter interactive mode);
 
+static int sandbox_cmdline_cb_jump(struct sandbox_state *state,
+  const char *arg)
+{
+   state-jumped = 1;
+
+   /*
+* TODO(s...@chromium.org): Note this causes problems for gdb which
+* wants to read debug data from the image.
+*
+* os_unlink(arg);
+*/
+
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(jump, 'j', 1, Jumped from previous U-Boot);
+
 static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
 const char *arg)
 {
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index e8e4fea..304104e 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -30,7 +30,8 @@ struct sandbox_state {
enum exit_type_id exit_type;/* How we exited U-Boot */
const char *parse_err;  /* Error to report from parsing */
int argc;   /* Program arguments */
-   char **argv;
+   char **argv;/* Command line arguments */
+   bool jumped;/* Jumped from previous U_Boot */
uint8_t *ram_buf;   /* Emulated RAM buffer */
unsigned int ram_size;  /* Size of RAM buffer */
const char *ram_buf_fname;  /* Filename to use for RAM buffer */
-- 
1.8.4.1

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


[U-Boot] [PATCH 08/32] sandbox: Correct data sizes and printf() strings in fdtdec.c

2013-11-10 Thread Simon Glass
There are a few wwrnings in this file when building for sandbox. Addresses
coming from the device tree need to be treated as ulong as elsewhere in
U-Boot and we must use map_sysmem() to convert to a pointer when needed.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Hung-ying Tyan ty...@chromium.org
---
 lib/fdtdec.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 51fa868..207314f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -86,10 +86,10 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
size = (fdt_size_t *)((char *)cell +
sizeof(fdt_addr_t));
*sizep = fdt_size_to_cpu(*size);
-   debug(addr=%p, size=%p\n, (void *)addr,
- (void *)*sizep);
+   debug(addr=%08lx, size=%08x\n,
+ (ulong)addr, *sizep);
} else {
-   debug(%p\n, (void *)addr);
+   debug(%08lx\n, (ulong)addr);
}
return addr;
}
@@ -611,7 +611,7 @@ int fdtdec_decode_region(const void *blob, int node,
if (!cell || (len != sizeof(fdt_addr_t) * 2))
return -1;
 
-   *ptrp = (void *)fdt_addr_to_cpu(*cell);
+   *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size);
*size = fdt_size_to_cpu(cell[1]);
debug(%s: size=%zx\n, __func__, *size);
return 0;
-- 
1.8.4.1

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


[U-Boot] [PATCH 10/32] sandbox: block driver using host file/device as backing store

2013-11-10 Thread Simon Glass
From: Henrik Nordström hen...@henriknordstrom.net

Provide a way to use any host file or device as a block device in U-Boot.
This can be used to provide filesystem access within U-Boot to an ext2
image file on the host, for example.

The support is plumbed into the filesystem and partition interfaces.

We don't want to print a message in the driver every time we find a missing
device. Pass the information back to the caller where a message can be printed
if desired.

Signed-off-by: Henrik Nordström hen...@henriknordstrom.net
Signed-off-by: Simon Glass s...@chromium.org
- Removed change to part.c get_device_and_partition()

Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
---
 common/cmd_sandbox.c   |  64 +++
 disk/part.c|   6 +++
 drivers/block/Makefile |   1 +
 drivers/block/sandbox.c| 124 +
 include/config_fallbacks.h |   3 +-
 include/configs/sandbox.h  |   3 ++
 include/part.h |   5 ++
 include/sandboxblockdev.h  |  18 +++
 8 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 drivers/block/sandbox.c
 create mode 100644 include/sandboxblockdev.h

diff --git a/common/cmd_sandbox.c b/common/cmd_sandbox.c
index 8d59364..00982b1 100644
--- a/common/cmd_sandbox.c
+++ b/common/cmd_sandbox.c
@@ -6,6 +6,9 @@
 
 #include common.h
 #include fs.h
+#include part.h
+#include sandboxblockdev.h
+#include asm/errno.h
 
 static int do_sandbox_load(cmd_tbl_t *cmdtp, int flag, int argc,
   char * const argv[])
@@ -25,10 +28,69 @@ static int do_sandbox_save(cmd_tbl_t *cmdtp, int flag, int 
argc,
return do_save(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
 }
 
+static int do_sandbox_bind(cmd_tbl_t *cmdtp, int flag, int argc,
+  char * const argv[])
+{
+   if (argc  2 || argc  3)
+   return CMD_RET_USAGE;
+   char *ep;
+   char *dev_str = argv[1];
+   char *file = argc = 3 ? argv[2] : NULL;
+   int dev = simple_strtoul(dev_str, ep, 16);
+   if (*ep) {
+   printf(** Bad device specification %s **\n, dev_str);
+   return CMD_RET_USAGE;
+   }
+   return host_dev_bind(dev, file);
+}
+
+static int do_sandbox_info(cmd_tbl_t *cmdtp, int flag, int argc,
+  char * const argv[])
+{
+   if (argc  1 || argc  2)
+   return CMD_RET_USAGE;
+   int min_dev = 0;
+   int max_dev = CONFIG_HOST_MAX_DEVICES - 1;
+   if (argc = 2) {
+   char *ep;
+   char *dev_str = argv[1];
+   int dev = simple_strtoul(dev_str, ep, 16);
+   if (*ep) {
+   printf(** Bad device specification %s **\n, dev_str);
+   return CMD_RET_USAGE;
+   }
+   min_dev = dev;
+   max_dev = dev;
+   }
+   int dev;
+   printf(%3s %12s %s\n, dev, blocks, path);
+   for (dev = min_dev; dev = max_dev; dev++) {
+   block_dev_desc_t *blk_dev;
+   int ret;
+
+   printf(%3d , dev);
+   ret = host_get_dev_err(dev, blk_dev);
+   if (ret) {
+   if (ret == -ENOENT)
+   puts(Not bound to a backing file\n);
+   else if (ret == -ENODEV)
+   puts(Invalid host device number\n);
+
+   continue;
+   }
+   struct host_block_dev *host_dev = blk_dev-priv;
+   printf(%12lu %s\n, (unsigned long)blk_dev-lba,
+  host_dev-filename);
+   }
+   return 0;
+}
+
 static cmd_tbl_t cmd_sandbox_sub[] = {
U_BOOT_CMD_MKENT(load, 7, 0, do_sandbox_load, , ),
U_BOOT_CMD_MKENT(ls, 3, 0, do_sandbox_ls, , ),
U_BOOT_CMD_MKENT(save, 6, 0, do_sandbox_save, , ),
+   U_BOOT_CMD_MKENT(bind, 3, 0, do_sandbox_bind, , ),
+   U_BOOT_CMD_MKENT(info, 3, 0, do_sandbox_info, , ),
 };
 
 static int do_sandbox(cmd_tbl_t *cmdtp, int flag, int argc,
@@ -57,4 +119,6 @@ U_BOOT_CMD(
sb ls host filename  - list files on host\n
sb save host dev filename addr bytes [offset] - 
save a file to host\n
+   sb bind dev [filename] - bind \host\ device to file\n
+   sb info [dev]- show device binding  info
 );
diff --git a/disk/part.c b/disk/part.c
index 93dff03..b8c6aac 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -43,6 +43,9 @@ static const struct block_drvr block_drvr[] = {
 #if defined(CONFIG_SYSTEMACE)
{ .name = ace, .get_dev = systemace_get_dev, },
 #endif
+#if defined(CONFIG_SANDBOX)
+   { .name = host, .get_dev = host_get_dev, },
+#endif
{ },
 };
 
@@ -286,6 +289,9 @@ static void print_part_header (const char *type, 
block_dev_desc_t * dev_desc)
case IF_TYPE_MMC:
puts (MMC);

[U-Boot] [PATCH 32/32] sandbox: Add LCD driver

2013-11-10 Thread Simon Glass
Add a simple LCD driver which uses SDL to display the image. We update the
image regularly, while still providing for reasonable performance.

Adjust the common lcd code to support sandbox.

For command-line runs we do not want the LCD to be displayed, so add a
--hide_lcd option to disable it.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Tested-by: Che-Liang Chiou clch...@chromium.org
---
 arch/sandbox/cpu/sdl.c|  4 +-
 arch/sandbox/cpu/start.c  |  9 
 arch/sandbox/include/asm/state.h  |  1 +
 arch/sandbox/include/asm/u-boot-sandbox.h |  3 ++
 board/sandbox/sandbox/sandbox.c   | 19 +++-
 common/lcd.c  | 21 ++--
 doc/device-tree-bindings/video/sandbox-fb.txt | 13 +
 drivers/serial/sandbox.c  |  4 ++
 drivers/video/Makefile|  1 +
 drivers/video/sandbox_sdl.c   | 70 +++
 include/fdtdec.h  |  1 +
 include/lcd.h |  3 ++
 lib/fdtdec.c  |  1 +
 13 files changed, 144 insertions(+), 6 deletions(-)
 create mode 100644 doc/device-tree-bindings/video/sandbox-fb.txt
 create mode 100644 drivers/video/sandbox_sdl.c

diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
index 909e835..917936f 100644
--- a/arch/sandbox/cpu/sdl.c
+++ b/arch/sandbox/cpu/sdl.c
@@ -55,7 +55,9 @@ static int sandbox_sdl_ensure_init(void)
 
 int sandbox_sdl_init_display(int width, int height, int log2_bpp)
 {
-   if (!width)
+   struct sandbox_state *state = state_get_current();
+
+   if (!width || state-hide_lcd)
return 0;
if (sandbox_sdl_ensure_init())
return -1;
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 2d19fe7..6189ded 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -175,6 +175,15 @@ static int sandbox_cmdline_cb_ignore_missing(struct 
sandbox_state *state,
 SANDBOX_CMDLINE_OPT_SHORT(ignore_missing, 'n', 0,
  Ignore missing state on read);
 
+static int sandbox_cmdline_cb_hide_lcd(struct sandbox_state *state,
+  const char *arg)
+{
+   state-hide_lcd = true;
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(hide_lcd, 'l', 0,
+ Don't show the sandbox LCD display);
+
 int main(int argc, char *argv[])
 {
struct sandbox_state *state;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 304104e..9263aca 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -41,6 +41,7 @@ struct sandbox_state {
bool read_state;/* Read sandbox state on startup */
bool write_state;   /* Write sandbox state on exit */
bool ignore_missing_state_on_read;  /* No error if state missing */
+   bool hide_lcd;  /* Hide LCD on start-up */
 
/* Pointer to information for each SPI bus/cs */
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h 
b/arch/sandbox/include/asm/u-boot-sandbox.h
index 5707c27..d2f1b65 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -25,4 +25,7 @@ int sandbox_main_loop_init(void);
 
 int cleanup_before_linux(void);
 
+/* drivers/video/sandbox_sdl.c */
+int sandbox_lcd_sdl_early_init(void);
+
 #endif /* _U_BOOT_SANDBOX_H_ */
diff --git a/board/sandbox/sandbox/sandbox.c b/board/sandbox/sandbox/sandbox.c
index 65dcce8..f3ab575 100644
--- a/board/sandbox/sandbox/sandbox.c
+++ b/board/sandbox/sandbox/sandbox.c
@@ -4,8 +4,8 @@
  */
 
 #include common.h
-
 #include os.h
+#include asm/u-boot-sandbox.h
 
 /*
  * Pointer to initial global data area
@@ -33,3 +33,20 @@ int dram_init(void)
gd-ram_size = CONFIG_SYS_SDRAM_SIZE;
return 0;
 }
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_VIDEO_SANDBOX_SDL
+   int ret;
+
+   ret = sandbox_lcd_sdl_early_init();
+   if (ret) {
+   puts(Could not init sandbox LCD emulation\n);
+   return ret;
+   }
+#endif
+
+   return 0;
+}
+#endif
diff --git a/common/lcd.c b/common/lcd.c
index 5dd7948..bbbede1 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -28,6 +28,8 @@
 #include watchdog.h
 
 #include splash.h
+#include asm/io.h
+#include asm/unaligned.h
 
 #if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
defined(CONFIG_CPU_MONAHANS)
@@ -63,6 +65,10 @@
 # endif
 #endif
 
+#ifdef CONFIG_SANDBOX
+#include asm/sdl.h
+#endif
+
 #ifndef CONFIG_LCD_ALIGNMENT
 #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
 #endif
@@ -144,6 +150,13 @@ void lcd_sync(void)
if (lcd_flush_dcache)

[U-Boot] [PATCH 19/32] sandbox: tpm: Add TPM emulation

2013-11-10 Thread Simon Glass
Add a simple TPM emulator for sandbox. It only supports a small subset of
TPM operations. However, these are enough to perform common tasks.

Note this is an initial commit to get this working, but it could use
cleaning up (for example constants instead of open-coded values).

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

Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
---
 drivers/tpm/Makefile  |   1 +
 drivers/tpm/tpm_tis_sandbox.c | 262 ++
 include/configs/sandbox.h |   2 +
 3 files changed, 265 insertions(+)
 create mode 100644 drivers/tpm/tpm_tis_sandbox.c

diff --git a/drivers/tpm/Makefile b/drivers/tpm/Makefile
index 4b8cbec..82562b1 100644
--- a/drivers/tpm/Makefile
+++ b/drivers/tpm/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_TPM_ATMEL_TWI) += tpm_atmel_twi.o
 obj-$(CONFIG_TPM_TIS_I2C) += tpm.o
 obj-$(CONFIG_TPM_TIS_I2C) += tpm_tis_i2c.o
 obj-$(CONFIG_TPM_TIS_LPC) += tpm_tis_lpc.o
+obj-$(CONFIG_TPM_TIS_SANDBOX) += tpm_tis_sandbox.o
diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c
new file mode 100644
index 000..80cf734
--- /dev/null
+++ b/drivers/tpm/tpm_tis_sandbox.c
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include asm/state.h
+#include asm/unaligned.h
+#include linux/crc8.h
+
+/* TPM NVRAM location indices. */
+#define FIRMWARE_NV_INDEX  0x1007
+#define KERNEL_NV_INDEX0x1008
+
+#define NV_DATA_PUBLIC_PERMISSIONS_OFFSET  60
+
+/* Kernel TPM space - KERNEL_NV_INDEX, locked with physical presence */
+#define ROLLBACK_SPACE_KERNEL_VERSION  2
+#define ROLLBACK_SPACE_KERNEL_UID  0x4752574C  /* 'GRWL' */
+
+struct rollback_space_kernel {
+   /* Struct version, for backwards compatibility */
+   uint8_t struct_version;
+   /* Unique ID to detect space redefinition */
+   uint32_t uid;
+   /* Kernel versions */
+   uint32_t kernel_versions;
+   /* Reserved for future expansion */
+   uint8_t reserved[3];
+   /* Checksum (v2 and later only) */
+   uint8_t crc8;
+} __packed rollback_space_kernel;
+
+/*
+ * These numbers derive from adding the sizes of command fields as shown in
+ * the TPM commands manual.
+ */
+#define TPM_REQUEST_HEADER_LENGTH  10
+#define TPM_RESPONSE_HEADER_LENGTH 10
+
+/* These are the different non-volatile spaces that we emulate */
+enum {
+   NV_GLOBAL_LOCK,
+   NV_SEQ_FIRMWARE,
+   NV_SEQ_KERNEL,
+   NV_SEQ_COUNT,
+};
+
+/* Size of each non-volatile space */
+#define NV_DATA_SIZE   0x20
+
+/*
+ * Information about our TPM emulation. This is preserved in the sandbox
+ * state file if enabled.
+ */
+static struct tpm_state {
+   uint8_t nvdata[NV_SEQ_COUNT][NV_DATA_SIZE];
+} state;
+
+/**
+ * sandbox_tpm_read_state() - read the sandbox EC state from the state file
+ *
+ * If data is available, then blob and node will provide access to it. If
+ * not this function sets up an empty TPM.
+ *
+ * @blob: Pointer to device tree blob, or NULL if no data to read
+ * @node: Node offset to read from
+ */
+static int sandbox_tpm_read_state(const void *blob, int node)
+{
+   const char *prop;
+   int len;
+   int i;
+
+   if (!blob)
+   return 0;
+
+   for (i = 0; i  NV_SEQ_COUNT; i++) {
+   char prop_name[20];
+
+   sprintf(prop_name, nvdata%d, i);
+   prop = fdt_getprop(blob, node, prop_name, len);
+   if (prop  len == NV_DATA_SIZE)
+   memcpy(state.nvdata[i], prop, NV_DATA_SIZE);
+   }
+
+   return 0;
+}
+
+/**
+ * cros_ec_write_state() - Write out our state to the state file
+ *
+ * The caller will ensure that there is a node ready for the state. The node
+ * may already contain the old state, in which case it is overridden.
+ *
+ * @blob: Device tree blob holding state
+ * @node: Node to write our state into
+ */
+static int sandbox_tpm_write_state(void *blob, int node)
+{
+   int i;
+
+   /*
+* We are guaranteed enough space to write basic properties.
+* We could use fdt_add_subnode() to put each set of data in its
+* own node - perhaps useful if we add access informaiton to each.
+*/
+   for (i = 0; i  NV_SEQ_COUNT; i++) {
+   char prop_name[20];
+
+   sprintf(prop_name, nvdata%d, i);
+   fdt_setprop(blob, node, prop_name, state.nvdata[i],
+   NV_DATA_SIZE);
+   }
+
+   return 0;
+}
+
+SANDBOX_STATE_IO(sandbox_tpm, google,sandbox-tpm, sandbox_tpm_read_state,
+sandbox_tpm_write_state);
+
+static int index_to_seq(uint32_t index)
+{
+   switch (index) {
+   case FIRMWARE_NV_INDEX:
+   return NV_SEQ_FIRMWARE;
+   case KERNEL_NV_INDEX:
+   return NV_SEQ_KERNEL;
+   case 0:
+   return 

[U-Boot] [PATCH 02/32] sandbox: Use system headers first for sandbox's os.c

2013-11-10 Thread Simon Glass
This file must be compiled with system headers, even if U-Boot has headers
of the same name. The existing solution for this is good enough for libfdt,
but fails when we have headers like stdint.h in U-Boot.

Use -idirafter instead of -I, and remove the -nostdinc and other things
that we don't want for this file. The best way to do this is to keep a
copy of the original flags, rather than trying to filter them later.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/Makefile | 6 --
 config.mk | 9 +++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index 404ff67..58c2537 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -10,5 +10,7 @@
 obj-y  := cpu.o os.o start.o state.o
 
 # os.c is build in the system environment, so needs standard includes
-$(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
-$(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,$(CPPFLAGS))
+$(obj)os.o: ALL_CFLAGS := $(BASE_CPPFLAGS) \
+   $(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
+$(obj).depend.os: CPPFLAGS := $(BASE_CPPFLAGS) \
+   $(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
diff --git a/config.mk b/config.mk
index 3441387..f2f1037 100644
--- a/config.mk
+++ b/config.mk
@@ -256,11 +256,16 @@ Please undefined CONFIG_SYS_GENERIC_BOARD in your board 
config file)
 endif
 endif
 
+# Sandbox needs the base flags and includes, so keep them around
+BASE_CPPFLAGS := $(CPPFLAGS)
+
 ifneq ($(OBJTREE),$(SRCTREE))
-CPPFLAGS += -I$(OBJTREE)/include
+BASE_INCLUDE_DIRS := $(OBJTREE)/include
 endif
 
-CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
+BASE_INCLUDE_DIRS += $(TOPDIR)/include $(SRCTREE)/arch/$(ARCH)/include
+
+CPPFLAGS += $(patsubst %, -I%, $(BASE_INCLUDE_DIRS))
 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc  \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
 
-- 
1.8.4.1

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


[U-Boot] [PATCH 12/32] sandbox: Correct help message arg garbling

2013-11-10 Thread Simon Glass
The arg is displayed for options with no argument, and omitted for those
with an argument. Swap this around.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/start.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 1b15454..951ac63 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -50,9 +50,9 @@ int sandbox_early_getopt_check(void)
 
/* then the long flag */
if (opt-has_arg)
-   printf(--%-*s, max_noarg_len, opt-flag);
-   else
printf(--%-*s arg , max_arg_len, opt-flag);
+   else
+   printf(--%-*s, max_noarg_len, opt-flag);
 
/* finally the help text */
printf(  %s\n, opt-help);
-- 
1.8.4.1

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


[U-Boot] [PATCH 31/32] sandbox: Add a simple sound driver

2013-11-10 Thread Simon Glass
Add a sound driver for sandbox, which uses SDL.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Tested-by: Che-Liang Chiou clch...@chromium.org
---
 arch/sandbox/include/asm/arch-sandbox/sound.h | 14 ++
 drivers/sound/Makefile|  2 ++
 drivers/sound/sandbox.c   | 23 +++
 3 files changed, 39 insertions(+)
 create mode 100644 arch/sandbox/include/asm/arch-sandbox/sound.h
 create mode 100644 drivers/sound/sandbox.c

diff --git a/arch/sandbox/include/asm/arch-sandbox/sound.h 
b/arch/sandbox/include/asm/arch-sandbox/sound.h
new file mode 100644
index 000..a32e8c8
--- /dev/null
+++ b/arch/sandbox/include/asm/arch-sandbox/sound.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __SANDBOX_SOUND_H
+#define __SANDBOX_SOUND_H
+
+int sound_play(unsigned int msec, unsigned int frequency);
+
+int sound_init(const void *blob);
+
+#endif
diff --git a/drivers/sound/Makefile b/drivers/sound/Makefile
index 6d25292..3793f8a 100644
--- a/drivers/sound/Makefile
+++ b/drivers/sound/Makefile
@@ -7,5 +7,7 @@
 
 obj-$(CONFIG_SOUND)+= sound.o
 obj-$(CONFIG_I2S)  += samsung-i2s.o
+obj-$(CONFIG_I2S_SAMSUNG)  += samsung-i2s.o
+obj-$(CONFIG_SOUND_SANDBOX)+= sandbox.o
 obj-$(CONFIG_SOUND_WM8994) += wm8994.o
 obj-$(CONFIG_SOUND_MAX98095)   += max98095.o
diff --git a/drivers/sound/sandbox.c b/drivers/sound/sandbox.c
new file mode 100644
index 000..fe5c9e9
--- /dev/null
+++ b/drivers/sound/sandbox.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include asm/arch/sound.h
+#include asm/sdl.h
+
+int sound_play(uint32_t msec, uint32_t frequency)
+{
+   sandbox_sdl_sound_start(frequency);
+   mdelay(msec);
+   sandbox_sdl_sound_stop();
+
+   return 0;
+}
+
+int sound_init(const void *blob)
+{
+   return sandbox_sdl_sound_init();
+}
-- 
1.8.4.1

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


[U-Boot] [PATCH 03/32] sandbox: Use uint64_t instead of u64 for time

2013-11-10 Thread Simon Glass
The uint64_t type is defined in linux/types.h, so is safer than u64, which
is not actually a Linux type.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/os.c | 3 ++-
 include/os.h  | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index c4bdbb0..26f44cb 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -8,6 +8,7 @@
 #include fcntl.h
 #include getopt.h
 #include stdio.h
+#include stdint.h
 #include stdlib.h
 #include string.h
 #include termios.h
@@ -136,7 +137,7 @@ void os_usleep(unsigned long usec)
usleep(usec);
 }
 
-u64 __attribute__((no_instrument_function)) os_get_nsec(void)
+uint64_t __attribute__((no_instrument_function)) os_get_nsec(void)
 {
 #if defined(CLOCK_MONOTONIC)  defined(_POSIX_MONOTONIC_CLOCK)
struct timespec tp;
diff --git a/include/os.h b/include/os.h
index 8665f70..950433d 100644
--- a/include/os.h
+++ b/include/os.h
@@ -11,6 +11,8 @@
 #ifndef __OS_H__
 #define __OS_H__
 
+#include linux/types.h
+
 struct sandbox_state;
 
 /**
@@ -116,7 +118,7 @@ void os_usleep(unsigned long usec);
  *
  * \return A monotonic increasing time scaled in nano seconds
  */
-u64 os_get_nsec(void);
+uint64_t os_get_nsec(void);
 
 /**
  * Parse arguments and update sandbox state.
-- 
1.8.4.1

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


[U-Boot] [PATCH 04/32] sandbox: Increase memory size to 32MB

2013-11-10 Thread Simon Glass
The current 4MB size is a little small for some tests, so increase it.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Hung-ying Tyan ty...@chromium.org
---
 include/configs/sandbox.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 5868753..3444c22 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -53,7 +53,7 @@
 /*
  * Size of malloc() pool, although we don't actually use this yet.
  */
-#define CONFIG_SYS_MALLOC_LEN  (4  20)   /* 4MB  */
+#define CONFIG_SYS_MALLOC_LEN  (32  20)  /* 32MB  */
 
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_LONGHELP/* #undef to save memory */
-- 
1.8.4.1

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


[U-Boot] [PATCH 15/32] sandbox: Allow the console to work earlier

2013-11-10 Thread Simon Glass
With sandbox, errors and problems may be reported before console_init_f()
is executed. For example, an argument may not parse correctly or U-Boot may
panic(). At present this output is swallowed so there is no indication what
is going wrong.

Adjust the console to deal with a very early sandbox setup, by detecting that
there is no global_data yet, and calling os functions in that case.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/os.c | 11 +++
 common/console.c  | 16 +++-
 include/os.h  | 20 
 3 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 88dd371..ef6a651 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -388,3 +388,14 @@ ssize_t os_get_filesize(const char *fname)
return ret;
return buf.st_size;
 }
+
+void os_putc(int ch)
+{
+   putchar(ch);
+}
+
+void os_puts(const char *str)
+{
+   while (*str)
+   os_putc(*str++);
+}
diff --git a/common/console.c b/common/console.c
index cc55068..2dfb788 100644
--- a/common/console.c
+++ b/common/console.c
@@ -8,6 +8,7 @@
 #include common.h
 #include stdarg.h
 #include malloc.h
+#include os.h
 #include serial.h
 #include stdio_dev.h
 #include exports.h
@@ -415,6 +416,12 @@ static inline void print_pre_console_buffer(void) {}
 
 void putc(const char c)
 {
+#ifdef CONFIG_SANDBOX
+   if (!gd) {
+   os_putc(c);
+   return;
+   }
+#endif
 #ifdef CONFIG_SILENT_CONSOLE
if (gd-flags  GD_FLG_SILENT)
return;
@@ -439,6 +446,13 @@ void putc(const char c)
 
 void puts(const char *s)
 {
+#ifdef CONFIG_SANDBOX
+   if (!gd) {
+   os_puts(s);
+   return;
+   }
+#endif
+
 #ifdef CONFIG_SILENT_CONSOLE
if (gd-flags  GD_FLG_SILENT)
return;
@@ -467,7 +481,7 @@ int printf(const char *fmt, ...)
uint i;
char printbuffer[CONFIG_SYS_PBSIZE];
 
-#ifndef CONFIG_PRE_CONSOLE_BUFFER
+#if !defined(CONFIG_SANDBOX)  !defined(CONFIG_PRE_CONSOLE_BUFFER)
if (!gd-have_console)
return 0;
 #endif
diff --git a/include/os.h b/include/os.h
index 1575a96..d302b36 100644
--- a/include/os.h
+++ b/include/os.h
@@ -209,4 +209,24 @@ const char *os_dirent_get_typename(enum os_dirent_t type);
  */
 ssize_t os_get_filesize(const char *fname);
 
+/**
+ * Write a character to the controlling OS terminal
+ *
+ * This bypasses the U-Boot console support and writes directly to the OS
+ * stdout file descriptor.
+ *
+ * @param ch   Character to write
+ */
+void os_putc(int ch);
+
+/**
+ * Write a string to the controlling OS terminal
+ *
+ * This bypasses the U-Boot console support and writes directly to the OS
+ * stdout file descriptor.
+ *
+ * @param str  String to write (note that \n is not appended)
+ */
+void os_puts(const char *str);
+
 #endif
-- 
1.8.4.1

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


[U-Boot] [PATCH 18/32] sandbox: Add facility to save/restore sandbox state

2013-11-10 Thread Simon Glass
It is often useful to be able to save out the state from a sandbox test
run, for analysis or to restore it later to continue a test. Add generic
infrastructure for doing this using a device tree binary file. This is
a flexible tagged file format which is already supported by U-Boot, and
it supports hierarchy if needed.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Hung-ying Tyan ty...@chromium.org
---
 arch/sandbox/cpu/start.c |  49 +-
 arch/sandbox/cpu/state.c | 331 +++
 arch/sandbox/include/asm/state.h | 114 ++
 3 files changed, 490 insertions(+), 4 deletions(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 452f2a9..1df21d4 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -126,19 +126,56 @@ static int sandbox_cmdline_cb_memory(struct sandbox_state 
*state,
 SANDBOX_CMDLINE_OPT_SHORT(memory, 'm', 1,
  Read/write ram_buf memory contents from file);
 
+static int sandbox_cmdline_cb_state(struct sandbox_state *state,
+   const char *arg)
+{
+   state-state_fname = arg;
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(state, 's', 1, Specify the sandbox state FDT);
+
+static int sandbox_cmdline_cb_read(struct sandbox_state *state,
+  const char *arg)
+{
+   state-read_state = true;
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(read, 'r', 0, Read the state FDT on startup);
+
+static int sandbox_cmdline_cb_write(struct sandbox_state *state,
+   const char *arg)
+{
+   state-write_state = true;
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(write, 'w', 0, Write state FDT on exit);
+
+static int sandbox_cmdline_cb_ignore_missing(struct sandbox_state *state,
+const char *arg)
+{
+   state-ignore_missing_state_on_read = true;
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(ignore_missing, 'n', 0,
+ Ignore missing state on read);
+
 int main(int argc, char *argv[])
 {
struct sandbox_state *state;
-   int err;
+   int ret;
 
-   err = state_init();
-   if (err)
-   return err;
+   ret = state_init();
+   if (ret)
+   goto err;
 
state = state_get_current();
if (os_parse_args(state, argc, argv))
return 1;
 
+   ret = sandbox_read_state(state, state-state_fname);
+   if (ret)
+   goto err;
+
/* Do pre- and post-relocation init */
board_init_f(0);
 
@@ -146,4 +183,8 @@ int main(int argc, char *argv[])
 
/* NOTREACHED - board_init_r() does not return */
return 0;
+
+err:
+   printf(Error %d\n, ret);
+   return 1;
 }
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index 0380fe2..a145808 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -4,6 +4,8 @@
  */
 
 #include common.h
+#include errno.h
+#include fdtdec.h
 #include os.h
 #include asm/state.h
 
@@ -16,6 +18,324 @@ void state_record_exit(enum exit_type_id exit_type)
state-exit_type = exit_type;
 }
 
+static int state_ensure_space(int extra_size)
+{
+   void *blob = state-state_fdt;
+   int used, size, free;
+   void *buf;
+   int ret;
+
+   used = fdt_off_dt_strings(blob) + fdt_size_dt_strings(blob);
+   size = fdt_totalsize(blob);
+   free = size - used;
+   if (free  extra_size)
+   return 0;
+
+   size = used + extra_size;
+   buf = os_malloc(size);
+   if (!buf)
+   return -ENOMEM;
+
+   ret = fdt_open_into(blob, buf, size);
+   if (ret) {
+   os_free(buf);
+   return -EIO;
+   }
+
+   os_free(blob);
+   state-state_fdt = buf;
+   return 0;
+}
+
+static int state_read_file(struct sandbox_state *state, const char *fname)
+{
+   int size;
+   int ret;
+   int fd;
+
+   size = os_get_filesize(fname);
+   if (size  0) {
+   printf(Cannot find sandbox state file '%s'\n, fname);
+   return -ENOENT;
+   }
+   state-state_fdt = os_malloc(size);
+   if (!state-state_fdt) {
+   puts(No memory to read sandbox state\n);
+   return -ENOMEM;
+   }
+   fd = os_open(fname, OS_O_RDONLY);
+   if (fd  0) {
+   printf(Cannot open sandbox state file '%s'\n, fname);
+   ret = -EPERM;
+   goto err_open;
+   }
+   if (os_read(fd, state-state_fdt, size) != size) {
+   printf(Cannot read sandbox state file '%s'\n, fname);
+   ret = -EIO;
+   goto err_read;
+   }
+   os_close(fd);
+
+   return 0;
+err_read:
+   os_close(fd);
+err_open:
+   os_free(state-state_fdt);
+   state-state_fdt = NULL;
+
+   return ret;
+}
+

[U-Boot] [PATCH 20/32] sandbox: dts: Add display and keyboard to sandbox

2013-11-10 Thread Simon Glass
Add an LCD display and keyboard to the sandbox device tree so that these
features can be used.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 board/sandbox/dts/sandbox.dts | 62 +++
 1 file changed, 62 insertions(+)

diff --git a/board/sandbox/dts/sandbox.dts b/board/sandbox/dts/sandbox.dts
index 9d7700c..e380df2 100644
--- a/board/sandbox/dts/sandbox.dts
+++ b/board/sandbox/dts/sandbox.dts
@@ -26,4 +26,66 @@
colour = white;
sides = 6;
};
+
+   lcd {
+   compatible = sandbox,lcd-sdl;
+   xres = 800;
+   yres = 600;
+   };
+
+   cros-ec-keyb {
+   compatible = google,cros-ec-keyb;
+   google,key-rows = 8;
+   google,key-columns = 13;
+   google,repeat-delay-ms = 240;
+   google,repeat-rate-ms = 30;
+   google,ghost-filter;
+   /*
+* Keymap entries take the form of 0xRRCC where
+* RR=Row CC=Column =Key Code
+* The values below are for a US keyboard layout and
+* are taken from the Linux driver. Note that the
+* 102ND key is not used for US keyboards.
+*/
+   linux,keymap = 
+   /* CAPSLCK F1 B  F10 */
+   0x0001003a 0x0002003b 0x00030030 0x00040044
+   /* N   =  R_ALT  ESC */
+   0x00060031 0x0008000d 0x000a0064 0x01010001
+   /* F4  G  F7 H   */
+   0x0102003e 0x01030022 0x01040041 0x01060023
+   /* '   F9 BKSPACEL_CTRL  */
+   0x01080028 0x01090043 0x010b000e 0x021d
+   /* TAB F3 T  F6  */
+   0x0201000f 0x0202003d 0x02030014 0x02040040
+   /* ]   Y  102ND  [   */
+   0x0205001b 0x02060015 0x02070056 0x0208001a
+   /* F8  GRAVE  F2 5   */
+   0x02090042 0x03010029 0x0302003c 0x03030006
+   /* F5  6  -  \   */
+   0x0304003f 0x03060007 0x0308000c 0x030b002b
+   /* R_CTRL  A  D  F   */
+   0x0461 0x0401001e 0x04020020 0x04030021
+   /* S   K  J  ;   */
+   0x0404001f 0x04050025 0x04060024 0x04080027
+   /* L   ENTER  Z  C   */
+   0x04090026 0x040b001c 0x0501002c 0x0502002e
+   /* V   X  ,  M   */
+   0x0503002f 0x0504002d 0x05050033 0x05060032
+   /* L_SHIFT /  .  SPACE   */
+   0x0507002a 0x05080035 0x05090034 0x050B0039
+   /* 1   3  4  2   */
+   0x06010002 0x06020004 0x06030005 0x06040003
+   /* 8   7  0  9   */
+   0x06050009 0x06060008 0x0608000b 0x0609000a
+   /* L_ALT   DOWN   RIGHT  Q   */
+   0x060a0038 0x060b006c 0x060c006a 0x07010010
+   /* E   R  W  I   */
+   0x07020012 0x07030013 0x07040011 0x07050017
+   /* U   R_SHIFTP  O   */
+   0x07060016 0x07070036 0x07080019 0x07090018
+   /* UP  LEFT*/
+   0x070b0067 0x070c0069;
+   };
+
 };
-- 
1.8.4.1

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


[U-Boot] [PATCH 22/32] sandbox: tpm: Fix nvwrite command

2013-11-10 Thread Simon Glass
From: Che-Liang Chiou clch...@chromium.org

The original codes misused recvbuf in source buffer instead of sendbuf,
and read from incorrect offset 14 instead of 22.

Signed-off-by: Che-Liang Chiou clch...@chromium.org

Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
Tested-by: Che-Liang Chiou clch...@chromium.org
---
 drivers/tpm/tpm_tis_sandbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c
index 80cf734..ed4b039 100644
--- a/drivers/tpm/tpm_tis_sandbox.c
+++ b/drivers/tpm/tpm_tis_sandbox.c
@@ -190,9 +190,7 @@ int tis_sendrecv(const u8 *sendbuf, size_t send_size,
if (seq  0)
return -1;
printf(tpm: nvwrite index=%#02x, len=%#02x\n, index, length);
-   memcpy(tpm-nvdata[seq],
-  recvbuf + TPM_RESPONSE_HEADER_LENGTH + sizeof(uint32_t),
-  length);
+   memcpy(tpm-nvdata[seq], sendbuf + 22, length);
*recv_len = 12;
memset(recvbuf, '\0', *recv_len);
break;
-- 
1.8.4.1

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


[U-Boot] [PATCH 26/32] cros_ec: Add a function for decoding the Chrome OS EC flashmap

2013-11-10 Thread Simon Glass
In order to talk to the EC properly we need to be able to understand the
layout of its internal flash memory. This permits emulation of the EC
for sandbox, and also software system with a real EC.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 drivers/misc/cros_ec.c | 50 ++
 include/cros_ec.h  | 19 +++
 2 files changed, 69 insertions(+)

diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 301e8eb..1998653 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -958,6 +958,56 @@ int cros_ec_decode_region(int argc, char * const argv[])
return -1;
 }
 
+int cros_ec_decode_ec_flash(const void *blob, struct fdt_cros_ec *config)
+{
+   int flash_node, node;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_GOOGLE_CROS_EC);
+   if (node  0) {
+   debug(Failed to find chrome-ec node'\n);
+   return -1;
+   }
+
+   flash_node = fdt_subnode_offset(blob, node, flash);
+   if (flash_node  0) {
+   debug(Failed to find flash node\n);
+   return -1;
+   }
+
+   if (fdtdec_read_fmap_entry(blob, flash_node, flash,
+  config-flash)) {
+   debug(Failed to decode flash node in chrome-ec'\n);
+   return -1;
+   }
+
+   config-flash_erase_value = fdtdec_get_int(blob, flash_node,
+   erase-value, -1);
+   for (node = fdt_first_subnode(blob, flash_node); node = 0;
+node = fdt_next_subnode(blob, node)) {
+   const char *name = fdt_get_name(blob, node, NULL);
+   enum ec_flash_region region;
+
+   if (0 == strcmp(name, ro)) {
+   region = EC_FLASH_REGION_RO;
+   } else if (0 == strcmp(name, rw)) {
+   region = EC_FLASH_REGION_RW;
+   } else if (0 == strcmp(name, wp-ro)) {
+   region = EC_FLASH_REGION_WP_RO;
+   } else {
+   debug(Unknown EC flash region name '%s'\n, name);
+   return -1;
+   }
+
+   if (fdtdec_read_fmap_entry(blob, node, reg,
+  config-region[region])) {
+   debug(Failed to decode flash region in chrome-ec'\n);
+   return -1;
+   }
+   }
+
+   return 0;
+}
+
 /**
  * Perform a flash read or write command
  *
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 22eae90..999c3c9 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -63,6 +63,17 @@ struct mbkp_keyscan {
uint8_t data[CROS_EC_KEYSCAN_COLS];
 };
 
+/* Holds information about the Chrome EC */
+struct fdt_cros_ec {
+   struct fmap_entry flash;/* Address and size of EC flash */
+   /*
+* Byte value of erased flash, or -1 if not known. It is normally
+* 0xff but some flash devices use 0 (e.g. STM32Lxxx)
+*/
+   int flash_erase_value;
+   struct fmap_entry region[EC_FLASH_REGION_COUNT];
+};
+
 /**
  * Read the ID of the CROS-EC device
  *
@@ -449,4 +460,12 @@ int cros_ec_board_init(void);
  */
 int cros_ec_get_error(void);
 
+/**
+ * Returns information from the FDT about the Chrome EC flash
+ *
+ * @param blob FDT blob to use
+ * @param config   Structure to use to return information
+ */
+int cros_ec_decode_ec_flash(const void *blob, struct fdt_cros_ec *config);
+
 #endif
-- 
1.8.4.1

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


[U-Boot] [PATCH 30/32] sandbox: Add SDL library for LCD, keyboard, audio

2013-11-10 Thread Simon Glass
SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Signed-off-by: Simon Glass s...@chromium.org
Tested-by: Che-Liang Chiou clch...@chromium.org
---
 arch/sandbox/config.mk |   5 +
 arch/sandbox/cpu/Makefile  |   6 +
 arch/sandbox/cpu/sdl.c | 332 +
 arch/sandbox/include/asm/sdl.h |  20 +++
 4 files changed, 363 insertions(+)
 create mode 100644 arch/sandbox/cpu/sdl.c
 create mode 100644 arch/sandbox/include/asm/sdl.h

diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index 60b7262..01fe1fe 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -5,6 +5,11 @@ PLATFORM_CPPFLAGS += -DCONFIG_SANDBOX -D__SANDBOX__ 
-U_FORTIFY_SOURCE
 PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM -DCONFIG_SYS_GENERIC_BOARD
 PLATFORM_LIBS += -lrt
 
+ifdef CONFIG_SANDBOX_SDL
+PLATFORM_LIBS += $(shell sdl-config --libs)
+PLATFORM_CPPFLAGS += $(shell sdl-config --cflags)
+endif
+
 # Support generic board on sandbox
 __HAVE_ARCH_GENERIC_BOARD := y
 
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index 58c2537..f8b4345 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -8,9 +8,15 @@
 #
 
 obj-y  := cpu.o os.o start.o state.o
+obj-$(CONFIG_SANDBOX_SDL)  += sdl.o
 
 # os.c is build in the system environment, so needs standard includes
 $(obj)os.o: ALL_CFLAGS := $(BASE_CPPFLAGS) \
$(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
 $(obj).depend.os: CPPFLAGS := $(BASE_CPPFLAGS) \
$(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
+
+$(obj)sdl.o: ALL_CFLAGS := $(BASE_CPPFLAGS) \
+   $(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
+$(obj).depend.sdl: CPPFLAGS := $(BASE_CPPFLAGS) \
+   $(patsubst %, -idirafter %, $(BASE_INCLUDE_DIRS))
diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
new file mode 100644
index 000..909e835
--- /dev/null
+++ b/arch/sandbox/cpu/sdl.c
@@ -0,0 +1,332 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include linux/input.h
+#include SDL/SDL.h
+#include sound.h
+#include asm/state.h
+
+static struct sdl_info {
+   SDL_Surface *screen;
+   int width;
+   int height;
+   int depth;
+   int pitch;
+   uint frequency;
+   uint audio_pos;
+   uint audio_size;
+   uint8_t *audio_data;
+   bool audio_active;
+   bool inited;
+} sdl;
+
+static void sandbox_sdl_poll_events(void)
+{
+   SDL_Event event;
+
+   while (SDL_PollEvent(event)) {
+   switch (event.type) {
+   case SDL_QUIT:
+   puts(LCD window closed - quitting\n);
+   reset_cpu(1);
+   break;
+   }
+   }
+}
+
+static int sandbox_sdl_ensure_init(void)
+{
+   if (!sdl.inited) {
+   if (SDL_Init(0)  0) {
+   printf(Unable to initialize SDL: %s\n,
+  SDL_GetError());
+   return -1;
+   }
+
+   atexit(SDL_Quit);
+
+   sdl.inited = true;
+   }
+   return 0;
+}
+
+int sandbox_sdl_init_display(int width, int height, int log2_bpp)
+{
+   if (!width)
+   return 0;
+   if (sandbox_sdl_ensure_init())
+   return -1;
+   if (SDL_InitSubSystem(SDL_INIT_VIDEO)  0) {
+   printf(Unable to initialize SDL LCD: %s\n, SDL_GetError());
+   return -1;
+   }
+   SDL_WM_SetCaption(U-Boot, U-Boot);
+
+   sdl.width = width;
+   sdl.height = height;
+   sdl.depth = 1  log2_bpp;
+   sdl.pitch = sdl.width * sdl.depth / 8;
+   sdl.screen = SDL_SetVideoMode(width, height, 0, 0);
+   sandbox_sdl_poll_events();
+
+   return 0;
+}
+
+int sandbox_sdl_sync(void *lcd_base)
+{
+   SDL_Surface *frame;
+   SDL_Event event;
+
+   frame = SDL_CreateRGBSurfaceFrom(lcd_base, sdl.width, sdl.height,
+   sdl.depth, sdl.pitch,
+   0x1f  11, 0x3f  5, 0x1f  0, 0);
+   SDL_BlitSurface(frame, NULL, sdl.screen, NULL);
+   SDL_FreeSurface(frame);
+   SDL_UpdateRect(sdl.screen, 0, 0, 0, 0);
+   sandbox_sdl_poll_events();
+
+   return 0;
+}
+
+#define NONE (-1)
+#define NUM_SDL_CODES  (SDLK_UNDO + 1)
+
+static int16_t sdl_to_keycode[NUM_SDL_CODES] = {
+   /* 0 */
+   NONE, NONE, NONE, NONE, NONE,
+   

[U-Boot] [PATCH 27/32] cros_ec: sandbox: Add Chrome OS EC emulation

2013-11-10 Thread Simon Glass
Add a simple emulation of the Chrome OS EC for sandbox, so that it can
perform various EC tasks required by verified boot.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Vadim Bendebury vben...@chromium.org
---
 drivers/misc/Makefile  |   1 +
 drivers/misc/cros_ec_sandbox.c | 558 +
 include/cros_ec.h  |   8 +
 include/fdtdec.h   |   1 +
 lib/fdtdec.c   |   1 +
 5 files changed, 569 insertions(+)
 create mode 100644 drivers/misc/cros_ec_sandbox.c

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index d8ff9c6..4fb07c1 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_CBMEM_CONSOLE) += cbmem_console.o
 obj-$(CONFIG_CROS_EC) += cros_ec.o
 obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpc.o
 obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o
+obj-$(CONFIG_CROS_EC_SANDBOX) += cros_ec_sandbox.o
 obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
 obj-$(CONFIG_FSL_IIM) += fsl_iim.o
 obj-$(CONFIG_GPIO_LED) += gpio_led.o
diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c
new file mode 100644
index 000..7e543fe
--- /dev/null
+++ b/drivers/misc/cros_ec_sandbox.c
@@ -0,0 +1,558 @@
+/*
+ * Chromium OS cros_ec driver - sandbox emulation
+ *
+ * Copyright (c) 2013 The Chromium OS Authors.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include cros_ec.h
+#include errno.h
+#include hash.h
+#include malloc.h
+#include os.h
+#include sha256.h
+#include spi.h
+#include asm/state.h
+#include asm/sdl.h
+#include cros/cros_fdtdec.h
+#include linux/input.h
+
+/*
+ * Ultimately it shold be possible to connect an Chrome OS EC emulation
+ * to U-Boot and remove all of this code. But this provides a test
+ * environment for bringing up chromeos_sandbox and demonstrating its
+ * utility.
+ *
+ * This emulation includes the following:
+ *
+ * 1. Emulation of the keyboard, by converting keypresses received from SDL
+ * into key scan data, passed back from the EC as key scan messages. The
+ * key layout is read from the device tree.
+ *
+ * 2. Emulation of vboot context - so this can be read/written as required.
+ *
+ * 3. Save/restore of EC state, so that the vboot context, flash memory
+ * contents and current image can be preserved across boots. This is important
+ * since the EC is supposed to continue running even if the AP resets.
+ *
+ * 4. Some event support, in particular allowing Escape to be pressed on boot
+ * to enter recovery mode. The EC passes this to U-Boot through the normal
+ * event message.
+ *
+ * 5. Flash read/write/erase support, so that software sync works. The
+ * protect messages are supported but no protection is implemented.
+ *
+ * 6. Hashing of the EC image, again to support software sync.
+ *
+ * Other features can be added, although a better path is probably to link
+ * the EC image in with U-Boot (Vic has demonstrated a prototype for this).
+ */
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define KEYBOARD_ROWS  8
+#define KEYBOARD_COLS  13
+
+/* A single entry of the key matrix */
+struct ec_keymatrix_entry {
+   int row;/* key matrix row */
+   int col;/* key matrix column */
+   int keycode;/* corresponding linux key code */
+};
+
+/**
+ * struct ec_state - Information about the EC state
+ *
+ * @vbnv_context: Vboot context data stored by EC
+ * @ec_config: FDT config information about the EC (e.g. flashmap)
+ * @flash_data: Contents of flash memory
+ * @flash_data_len: Size of flash memory
+ * @current_image: Current image the EC is running
+ * @matrix_count: Number of keys to decode in matrix
+ * @matrix: Information about keyboard matrix
+ * @keyscan: Current keyscan information (bit set for each row/column pressed)
+ * @recovery_req: Keyboard recovery requested
+ */
+struct ec_state {
+   uint8_t vbnv_context[EC_VBNV_BLOCK_SIZE];
+   struct fdt_cros_ec ec_config;
+   uint8_t *flash_data;
+   int flash_data_len;
+   enum ec_current_image current_image;
+   int matrix_count;
+   struct ec_keymatrix_entry *matrix;  /* the key matrix info */
+   uint8_t keyscan[KEYBOARD_COLS];
+   bool recovery_req;
+} s_state, *state;
+
+/**
+ * cros_ec_read_state() - read the sandbox EC state from the state file
+ *
+ * If data is available, then blob and node will provide access to it. If
+ * not this function sets up an empty EC.
+ *
+ * @param blob: Pointer to device tree blob, or NULL if no data to read
+ * @param node: Node offset to read from
+ */
+static int cros_ec_read_state(const void *blob, int node)
+{
+   struct ec_state *ec = s_state;
+   const char *prop;
+   int len;
+
+   /* Set everything to defaults */
+   ec-current_image = EC_IMAGE_RO;
+   if (!blob)
+   return 0;
+
+   /* Read the data if available */
+   ec-current_image = fdtdec_get_int(blob, node, current-image,
+  

[U-Boot] [PATCH 14/32] sandbox: Implement the bootm command for sandbox

2013-11-10 Thread Simon Glass
When sandbox does a 'bootm' to run a kernel we cannot actually execute it.
So just exit sandbox, which is essentially what U-Boot does on other archs.
Also, allow sandbox to use bootm on any kernel, so that it can be used
to test booting of kernels from any architecture.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/cpu.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index cfc1fda..bc7641a 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -8,10 +8,16 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+void reset_cpu(ulong ignored)
 {
/* This is considered normal termination for now */
os_exit(0);
+}
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   reset_cpu(0);
+
return 0;
 }
 
@@ -28,7 +34,14 @@ unsigned long __attribute__((no_instrument_function)) 
timer_get_us(void)
 
 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
-   return -1;
+   if (flag  (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
+   bootstage_mark(BOOTSTAGE_ID_RUN_OS);
+   printf(## Transferring control to Linux (at address 
%08lx)...\n,
+  images-ep);
+   reset_cpu(0);
+   }
+
+   return 0;
 }
 
 int cleanup_before_linux(void)
-- 
1.8.4.1

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


[U-Boot] [PATCH 25/32] cros_ec: Move EC interface into common library

2013-11-10 Thread Simon Glass
From: Vadim Bendebury vben...@chromium.org

Add a common library for obtaining access to the Chrome OS EC. This is
used by boards which need to talk to the EC.

Signed-off-by: Vadim Bendebury vben...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Vadim Bendebury vben...@google.com
Tested-by: Vadim Bendebury vben...@google.com
---
 board/samsung/smdk5250/exynos5-dt.c |  5 -
 common/Makefile |  1 +
 common/cros_ec.c| 44 +
 include/cros_ec.h   | 18 +++
 4 files changed, 63 insertions(+), 5 deletions(-)
 create mode 100644 common/cros_ec.c

diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index 6bcc883..35888fd 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -73,11 +73,6 @@ static void  board_enable_audio_codec(void)
 }
 #endif
 
-struct cros_ec_dev *board_get_cros_ec_dev(void)
-{
-   return local.cros_ec_dev;
-}
-
 static int board_init_cros_ec_devices(const void *blob)
 {
local.cros_ec_err = cros_ec_init(blob, local.cros_ec_dev);
diff --git a/common/Makefile b/common/Makefile
index 32acbf9..2ba9880 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -222,6 +222,7 @@ obj-$(SPD) += ddr_spd.o
 obj-$(CONFIG_HWCONFIG) += hwconfig.o
 obj-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
 obj-y += console.o
+obj-$(CONFIG_CROS_EC) += cros_ec.o
 obj-y += dlmalloc.o
 obj-y += image.o
 obj-$(CONFIG_OF_LIBFDT) += image-fdt.o
diff --git a/common/cros_ec.c b/common/cros_ec.c
new file mode 100644
index 000..b8ce1b5
--- /dev/null
+++ b/common/cros_ec.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License (GPL) version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#include common.h
+#include cros_ec.h
+DECLARE_GLOBAL_DATA_PTR;
+
+struct local_info {
+   struct cros_ec_dev *cros_ec_dev;/* Pointer to cros_ec device */
+   int cros_ec_err;/* Error for cros_ec, 0 if ok */
+};
+
+static struct local_info local;
+
+struct cros_ec_dev *board_get_cros_ec_dev(void)
+{
+   return local.cros_ec_dev;
+}
+
+static int board_init_cros_ec_devices(const void *blob)
+{
+   local.cros_ec_err = cros_ec_init(blob, local.cros_ec_dev);
+   if (local.cros_ec_err)
+   return -1;  /* Will report in board_late_init() */
+
+   return 0;
+}
+
+int cros_ec_board_init(void)
+{
+   return board_init_cros_ec_devices(gd-fdt_blob);
+}
+
+int cros_ec_get_error(void)
+{
+   return local.cros_ec_err;
+}
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 1e89f29..22eae90 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -431,4 +431,22 @@ int cros_ec_set_ldo(struct cros_ec_dev *dev, uint8_t 
index, uint8_t state);
  * @return 0 if ok, -1 on error
  */
 int cros_ec_get_ldo(struct cros_ec_dev *dev, uint8_t index, uint8_t *state);
+
+/**
+ * Initialize the Chrome OS EC at board initialization time.
+ *
+ * @return 0 if ok, -ve on error
+ */
+int cros_ec_board_init(void);
+
+/**
+ * Get access to the error reported when cros_ec_board_init() was called
+ *
+ * This permits delayed reporting of the EC error if it failed during
+ * early init.
+ *
+ * @return error (0 if there was no error, -ve if there was an error)
+ */
+int cros_ec_get_error(void);
+
 #endif
-- 
1.8.4.1

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


[U-Boot] [PATCH 24/32] fdt: Add a function for reading a flash map entry

2013-11-10 Thread Simon Glass
A flash map describes the layout of flash memory in terms of offsets and
sizes for each region. Add a function to read a flash map entry from the
device tree.

(Unfortunately I had to change this commit to also touch cros/ but it is
a very small change and can be removed for upstreaming.)

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Che-Liang Chiou clch...@chromium.org
---
 include/fdtdec.h | 18 ++
 lib/fdtdec.c | 24 
 2 files changed, 42 insertions(+)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 433d6a7..26661e6 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -529,4 +529,22 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int 
node,
  */
 int fdtdec_decode_region(const void *blob, int node,
const char *prop_name, void **ptrp, size_t *size);
+
+/* A flash map entry, containing an offset and length */
+struct fmap_entry {
+   uint32_t offset;
+   uint32_t length;
+};
+
+/**
+ * Read a flash entry from the fdt
+ *
+ * @param blob FDT blob
+ * @param node Offset of node to read
+ * @param name Name of node being read
+ * @param entryPlace to put offset and size of this node
+ * @return 0 if ok, -ve on error
+ */
+int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
+  struct fmap_entry *entry);
 #endif
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 207314f..ab93e0d 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -616,3 +616,27 @@ int fdtdec_decode_region(const void *blob, int node,
debug(%s: size=%zx\n, __func__, *size);
return 0;
 }
+
+/**
+ * Read a flash entry from the fdt
+ *
+ * @param blob FDT blob
+ * @param node Offset of node to read
+ * @param name Name of node being read
+ * @param entryPlace to put offset and size of this node
+ * @return 0 if ok, -ve on error
+ */
+int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
+  struct fmap_entry *entry)
+{
+   u32 reg[2];
+
+   if (fdtdec_get_int_array(blob, node, reg, reg, 2)) {
+   debug(Node '%s' has bad/missing 'reg' property\n, name);
+   return -FDT_ERR_NOTFOUND;
+   }
+   entry-offset = reg[0];
+   entry-length = reg[1];
+
+   return 0;
+}
-- 
1.8.4.1

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


[U-Boot] [PATCH 13/32] sandbox: Allow return from board_init_f()

2013-11-10 Thread Simon Glass
The execution flow becomes easier if we can return from board_init_f()
as ARM does. We can control things from start.c instead of having to
call back into that file from other places.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/start.c | 11 ++-
 common/board_f.c |  8 +++-
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 951ac63..895c4d8 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -10,6 +10,8 @@
 
 #include os.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int sandbox_early_getopt_check(void)
 {
struct sandbox_state *state = state_get_current();
@@ -109,12 +111,11 @@ int main(int argc, char *argv[])
if (os_parse_args(state, argc, argv))
return 1;
 
-   /*
-* Do pre- and post-relocation init, then start up U-Boot. This will
-* never return.
-*/
+   /* Do pre- and post-relocation init */
board_init_f(0);
 
-   /* NOTREACHED - board_init_f() does not return */
+   board_init_r(gd-new_gd, 0);
+
+   /* NOTREACHED - board_init_r() does not return */
return 0;
 }
diff --git a/common/board_f.c b/common/board_f.c
index f8b8fa2..6e971f8 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -766,7 +766,7 @@ static int setup_reloc(void)
 }
 
 /* ARM calls relocate_code from its crt0.S */
-#if !defined(CONFIG_ARM)
+#if !defined(CONFIG_ARM)  !defined(CONFIG_SANDBOX)
 
 static int jump_to_copy(void)
 {
@@ -786,8 +786,6 @@ static int jump_to_copy(void)
 * (CPU cache)
 */
board_init_f_r_trampoline(gd-start_addr_sp);
-#elif defined(CONFIG_SANDBOX)
-   board_init_r(gd-new_gd, 0);
 #else
relocate_code(gd-start_addr_sp, gd-new_gd, gd-relocaddr);
 #endif
@@ -989,7 +987,7 @@ static init_fnc_t init_sequence_f[] = {
INIT_FUNC_WATCHDOG_RESET
reloc_fdt,
setup_reloc,
-#ifndef CONFIG_ARM
+#if !defined(CONFIG_ARM)  !defined(CONFIG_SANDBOX)
jump_to_copy,
 #endif
NULL,
@@ -1008,7 +1006,7 @@ void board_init_f(ulong boot_flags)
if (initcall_run_list(init_sequence_f))
hang();
 
-#ifndef CONFIG_ARM
+#if !defined(CONFIG_ARM)  !defined(CONFIG_SANDBOX)
/* NOTREACHED - jump_to_copy() does not return */
hang();
 #endif
-- 
1.8.4.1

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


[U-Boot] [PATCH 11/32] sandbox: Improve/augment memory allocation functions

2013-11-10 Thread Simon Glass
Implement realloc() and free() for sandbox, by adding a header to each
block which contains the block size.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
Reviewed-by: Che-Liang Chiou clch...@chromium.org
Reviewed-by: Hung-ying Tyan ty...@chromium.org
---
 arch/sandbox/cpu/os.c | 45 +++--
 include/os.h  | 29 +
 2 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 26f44cb..88dd371 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -27,6 +27,10 @@
 
 /* Operating System Interface */
 
+struct os_mem_hdr {
+   size_t length;  /* number of bytes in the block */
+};
+
 ssize_t os_read(int fd, void *buf, size_t count)
 {
return read(fd, buf, count);
@@ -128,8 +132,45 @@ void os_tty_raw(int fd)
 
 void *os_malloc(size_t length)
 {
-   return mmap(NULL, length, PROT_READ | PROT_WRITE,
-   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+   struct os_mem_hdr *hdr;
+
+   hdr = mmap(NULL, length + sizeof(*hdr), PROT_READ | PROT_WRITE,
+  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+   if (hdr == MAP_FAILED)
+   return NULL;
+   hdr-length = length;
+
+   return hdr + 1;
+}
+
+void *os_free(void *ptr)
+{
+   struct os_mem_hdr *hdr = ptr;
+
+   hdr--;
+   if (ptr)
+   munmap(hdr, hdr-length + sizeof(*hdr));
+}
+
+void *os_realloc(void *ptr, size_t length)
+{
+   struct os_mem_hdr *hdr = ptr;
+   void *buf = NULL;
+
+   hdr--;
+   if (length != 0) {
+   buf = os_malloc(length);
+   if (!buf)
+   return buf;
+   if (ptr) {
+   if (length  hdr-length)
+   length = hdr-length;
+   memcpy(buf, ptr, length);
+   }
+   }
+   os_free(ptr);
+
+   return buf;
 }
 
 void os_usleep(unsigned long usec)
diff --git a/include/os.h b/include/os.h
index 950433d..1575a96 100644
--- a/include/os.h
+++ b/include/os.h
@@ -107,6 +107,35 @@ void os_tty_raw(int fd);
 void *os_malloc(size_t length);
 
 /**
+ * Free memory previous allocated with os_malloc()/os_realloc()
+ *
+ * This returns the memory to the OS.
+ *
+ * \param ptr  Pointer to memory block to free
+ */
+void *os_free(void *ptr);
+
+/**
+ * Reallocate previously-allocated memory to increase/decrease space
+ *
+ * This works in a similar way to the C library realloc() function. If
+ * length is 0, then ptr is freed. Otherwise the space used by ptr is
+ * expanded or reduced depending on whether length is larger or smaller
+ * than before.
+ *
+ * If ptr is NULL, then this is similar to calling os_malloc().
+ *
+ * This function may need to move the memory block to make room for any
+ * extra space, in which case the new pointer is returned.
+ *
+ * \param ptr  Pointer to memory block to reallocate
+ * \param length   New length for memory block
+ * \return pointer to new memory block, or NULL on failure or if length
+ * is 0.
+ */
+void *os_realloc(void *ptr, size_t length);
+
+/**
  * Access to the usleep function of the os
  *
  * \param usec Time to sleep in micro seconds
-- 
1.8.4.1

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


[U-Boot] [PATCH 09/32] sandbox: Use os functions to read host device tree

2013-11-10 Thread Simon Glass
At present we use U-Boot's filesystem layer to read the sandbox device tree,
but this is problematic since it relies on a temporary feauture added
there. Since we plan to implement proper block layer support for sandbox,
change this code to use the os layer functions instead. Also use the new
fdt_create_empty_tree() instead of our own code.

Signed-off-by: Simon Glass s...@chromium.org
---
 common/board_f.c | 48 +---
 disk/part.c  | 17 -
 2 files changed, 21 insertions(+), 44 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index f0664bc..f8b8fa2 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -297,45 +297,39 @@ __weak int arch_cpu_init(void)
 
 #ifdef CONFIG_OF_HOSTFILE
 
-#define CHECK(x)   err = (x); if (err) goto failed;
-
-/* Create an empty device tree blob */
-static int make_empty_fdt(void *fdt)
-{
-   int err;
-
-   CHECK(fdt_create(fdt, 256));
-   CHECK(fdt_finish_reservemap(fdt));
-   CHECK(fdt_begin_node(fdt, ));
-   CHECK(fdt_end_node(fdt));
-   CHECK(fdt_finish(fdt));
-
-   return 0;
-failed:
-   printf(Unable to create empty FDT: %s\n, fdt_strerror(err));
-   return -EACCES;
-}
-
 static int read_fdt_from_file(void)
 {
struct sandbox_state *state = state_get_current();
+   const char *fname = state-fdt_fname;
void *blob;
-   int size;
+   ssize_t size;
int err;
+   int fd;
 
blob = map_sysmem(CONFIG_SYS_FDT_LOAD_ADDR, 0);
if (!state-fdt_fname) {
-   err = make_empty_fdt(blob);
+   err = fdt_create_empty_tree(blob, 256);
if (!err)
goto done;
-   return err;
+   printf(Unable to create empty FDT: %s\n, fdt_strerror(err));
+   return -EINVAL;
+   }
+
+   size = os_get_filesize(fname);
+   if (size  0) {
+   printf(Failed to file FDT file '%s'\n, fname);
+   return -ENOENT;
+   }
+   fd = os_open(fname, OS_O_RDONLY);
+   if (fd  0) {
+   printf(Failed to open FDT file '%s'\n, fname);
+   return -EACCES;
}
-   err = fs_set_blk_dev(host, NULL, FS_TYPE_SANDBOX);
-   if (err)
-   return err;
-   size = fs_read(state-fdt_fname, CONFIG_SYS_FDT_LOAD_ADDR, 0, 0);
-   if (size  0)
+   if (os_read(fd, blob, size) != size) {
+   os_close(fd);
return -EIO;
+   }
+   os_close(fd);
 
 done:
gd-fdt_blob = blob;
diff --git a/disk/part.c b/disk/part.c
index d2e34cf..93dff03 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -446,23 +446,6 @@ int get_device_and_partition(const char *ifname, const 
char *dev_part_str,
int part;
disk_partition_t tmpinfo;
 
-   /*
-* For now, we have a special case for sandbox, since there is no
-* real block device support.
-*/
-   if (0 == strcmp(ifname, host)) {
-   *dev_desc = NULL;
-   info-start = info-size =  info-blksz = 0;
-   info-bootable = 0;
-   strcpy((char *)info-type, BOOT_PART_TYPE);
-   strcpy((char *)info-name, Sandbox host);
-#ifdef CONFIG_PARTITION_UUIDS
-   info-uuid[0] = 0;
-#endif
-
-   return 0;
-   }
-
/* If no dev_part_str, use bootdevice environment variable */
if (!dev_part_str || !strlen(dev_part_str) ||
!strcmp(dev_part_str, -))
-- 
1.8.4.1

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


[U-Boot] [PATCH 17/32] sandbox: Allow reading/writing of RAM buffer

2013-11-10 Thread Simon Glass
It is useful to be able to save and restore the RAM contents of sandbox
U-Boot either for setting up tests, for later analysys, or for chaining
together multiple tests which need to keep the same memory contents.

Add a function to provide a memory file for U-Boot. This is read on
start-up and written when shutting down. If the file does not exist
on start-up, it will be created when shutting down.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/cpu.c |  4 
 arch/sandbox/cpu/os.c  | 39 ++
 arch/sandbox/cpu/start.c   | 22 +--
 arch/sandbox/cpu/state.c   | 22 +++
 arch/sandbox/include/asm/global_data.h |  2 +-
 arch/sandbox/include/asm/state.h   | 12 +++
 common/board_f.c   |  7 +++---
 include/os.h   | 16 ++
 8 files changed, 118 insertions(+), 6 deletions(-)

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index bc7641a..38019e0 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -5,11 +5,15 @@
 
 #include common.h
 #include os.h
+#include asm/state.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
 void reset_cpu(ulong ignored)
 {
+   if (state_uninit())
+   os_exit(2);
+
/* This is considered normal termination for now */
os_exit(0);
 }
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index ef6a651..725b505 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -399,3 +399,42 @@ void os_puts(const char *str)
while (*str)
os_putc(*str++);
 }
+
+int os_write_ram_buf(const char *fname)
+{
+   struct sandbox_state *state = state_get_current();
+   int fd, ret;
+
+   fd = open(fname, O_CREAT | O_WRONLY, 0777);
+   if (fd  0)
+   return -ENOENT;
+   ret = write(fd, state-ram_buf, state-ram_size);
+   close(fd);
+   if (ret != state-ram_size)
+   return -EIO;
+
+   return 0;
+}
+
+int os_read_ram_buf(const char *fname)
+{
+   struct sandbox_state *state = state_get_current();
+   int fd, ret;
+   int size;
+
+   size = os_get_filesize(fname);
+   if (size  0)
+   return -ENOENT;
+   if (size != state-ram_size)
+   return -ENOSPC;
+   fd = open(fname, O_RDONLY);
+   if (fd  0)
+   return -ENOENT;
+
+   ret = read(fd, state-ram_buf, state-ram_size);
+   close(fd);
+   if (ret != state-ram_size)
+   return -EIO;
+
+   return 0;
+}
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 579ece4..452f2a9 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -4,12 +4,11 @@
  */
 
 #include common.h
+#include os.h
 #include asm/getopt.h
 #include asm/sections.h
 #include asm/state.h
 
-#include os.h
-
 DECLARE_GLOBAL_DATA_PTR;
 
 int sandbox_early_getopt_check(void)
@@ -108,6 +107,25 @@ static int sandbox_cmdline_cb_interactive(struct 
sandbox_state *state,
 
 SANDBOX_CMDLINE_OPT_SHORT(interactive, 'i', 0, Enter interactive mode);
 
+static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
+const char *arg)
+{
+   int err;
+
+   /* For now assume we always want to write it */
+   state-write_ram_buf = true;
+   state-ram_buf_fname = arg;
+
+   if (os_read_ram_buf(arg)) {
+   printf(Failed to read RAM buffer\n);
+   return err;
+   }
+
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(memory, 'm', 1,
+ Read/write ram_buf memory contents from file);
+
 int main(int argc, char *argv[])
 {
struct sandbox_state *state;
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index 56d5041..0380fe2 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -4,6 +4,7 @@
  */
 
 #include common.h
+#include os.h
 #include asm/state.h
 
 /* Main state record for the sandbox */
@@ -25,6 +26,10 @@ int state_init(void)
 {
state = main_state;
 
+   state-ram_size = CONFIG_SYS_SDRAM_SIZE;
+   state-ram_buf = os_malloc(state-ram_size);
+   assert(state-ram_buf);
+
/*
 * Example of how to use GPIOs:
 *
@@ -33,3 +38,20 @@ int state_init(void)
 */
return 0;
 }
+
+int state_uninit(void)
+{
+   int err;
+
+   state = main_state;
+
+   if (state-write_ram_buf) {
+   err = os_write_ram_buf(state-ram_buf_fname);
+   if (err) {
+   printf(Failed to write RAM buffer\n);
+   return err;
+   }
+   }
+
+   return 0;
+}
diff --git a/arch/sandbox/include/asm/global_data.h 
b/arch/sandbox/include/asm/global_data.h
index d70532a..b2e9b48 100644
--- a/arch/sandbox/include/asm/global_data.h
+++ b/arch/sandbox/include/asm/global_data.h
@@ 

[U-Boot] [PATCH 0/32] Add additional sandbox features and infrastructure

2013-11-10 Thread Simon Glass
At present sandbox only supports a basic set of features. To help address
this, a recent series added SPI and SPI flash support; this series expands
the coverage further.

Firstly SDL is used to provide LCD and audio support. Sandbox gains its own
LCD driver which can display images, host a command line, etc. The audio
support is basic and needs additional work, but it is a starting point.
SDL also provides a keyboard emulation (using the Chrome OS EC code as a
base).

Secondly a TPM emulation is added. This does not include all features (the
implementation is quite simplistic) but it is enough to do basic secure
boot operations.

Finally, various pieces of useful infrastructure are adding, including:

- loading and saving of the emulated SDRAM to permit test runs to carry
over state
- loading and saving of general sandbox state (for example a driver can
save its stage and reload it on the next run)
- support for using bootm to load a kernel
- providing a device tree for use by sandbox
- block device emulation using host files
- a means to jump to another U-Boot while preserving state (useful for
test environments which want to run a series of tests with
script-selectable state)
- allowing the console to be active on start-up so that errors are not
silent supressed

The block device emulation provides access to filesystems from sandbox
which should make it possible to write comprehensive filesystem tests.

Major functions which still remain without sandbox support are I2C,
networking and USB.


Che-Liang Chiou (1):
  sandbox: tpm: Fix nvwrite command

Henrik Nordström (1):
  sandbox: block driver using host file/device as backing store

Simon Glass (29):
  Add crc8 routine
  sandbox: Use system headers first for sandbox's os.c
  sandbox: Use uint64_t instead of u64 for time
  sandbox: Increase memory size to 32MB
  sandbox: spi: Adjust 'sf test' to work on sandbox
  sandbox: Build a device tree file for sandbox
  sandbox: config: Don't use 64-bit physical memory
  sandbox: Correct data sizes and printf() strings in fdtdec.c
  sandbox: Use os functions to read host device tree
  sandbox: Improve/augment memory allocation functions
  sandbox: Correct help message arg garbling
  sandbox: Allow return from board_init_f()
  sandbox: Implement the bootm command for sandbox
  sandbox: Allow the console to work earlier
  sandbox: Add -i option to enter interactive mode
  sandbox: Allow reading/writing of RAM buffer
  sandbox: Add facility to save/restore sandbox state
  sandbox: tpm: Add TPM emulation
  sandbox: dts: Add display and keyboard to sandbox
  sandbox: Add a prototype for cleanup_before_linux()
  cros_ec: Add an enum for the number of flash regions
  fdt: Add a function for reading a flash map entry
  cros_ec: Add a function for decoding the Chrome OS EC flashmap
  cros_ec: sandbox: Add Chrome OS EC emulation
  sandbox: Add os_jump_to_image() to run another executable
  sandbox: Add -j option to indicate a jump from a previous U-Boot
  sandbox: Add SDL library for LCD, keyboard, audio
  sandbox: Add a simple sound driver
  sandbox: Add LCD driver

Vadim Bendebury (1):
  cros_ec: Move EC interface into common library

 Makefile  |   1 +
 arch/sandbox/config.mk|   7 +
 arch/sandbox/cpu/Makefile |  12 +-
 arch/sandbox/cpu/cpu.c|  21 +-
 arch/sandbox/cpu/os.c | 187 -
 arch/sandbox/cpu/sdl.c| 334 +++
 arch/sandbox/cpu/start.c  | 121 +-
 arch/sandbox/cpu/state.c  | 353 
 arch/sandbox/include/asm/arch-sandbox/sound.h |  14 +
 arch/sandbox/include/asm/global_data.h|   2 +-
 arch/sandbox/include/asm/sdl.h|  20 +
 arch/sandbox/include/asm/state.h  | 132 +-
 arch/sandbox/include/asm/types.h  |   4 +-
 arch/sandbox/include/asm/u-boot-sandbox.h |   5 +
 board/samsung/smdk5250/exynos5-dt.c   |   5 -
 board/sandbox/dts/sandbox.dts |  91 +
 board/sandbox/sandbox/sandbox.c   |  19 +-
 common/Makefile   |   1 +
 common/board_f.c  |  63 ++-
 common/cmd_sandbox.c  |  64 +++
 common/cmd_sf.c   |  14 +-
 common/console.c  |  16 +-
 common/cros_ec.c  |  44 ++
 common/lcd.c  |  21 +-
 config.mk |   9 +-
 disk/part.c   |  23 +-
 doc/device-tree-bindings/video/sandbox-fb.txt |  13 +
 drivers/block/Makefile|   1 +
 drivers/block/sandbox.c   | 124 ++
 drivers/misc/Makefile |   1 +
 drivers/misc/cros_ec.c|  50 +++
 drivers/misc/cros_ec_sandbox.c

[U-Boot] [PATCH 21/32] sandbox: Add a prototype for cleanup_before_linux()

2013-11-10 Thread Simon Glass
This function is defined but has no prototype declaration. Add it.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/include/asm/u-boot-sandbox.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h 
b/arch/sandbox/include/asm/u-boot-sandbox.h
index bed720c..5707c27 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -23,4 +23,6 @@ int dram_init(void);
 int sandbox_early_getopt_check(void);
 int sandbox_main_loop_init(void);
 
+int cleanup_before_linux(void);
+
 #endif /* _U_BOOT_SANDBOX_H_ */
-- 
1.8.4.1

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


Re: [U-Boot] Non-trivial merge conflicts between u-boot/master and u-boot-arm/master

2013-11-10 Thread Gerhard Sittig
On Sat, Nov 09, 2013 at 14:50 -0500, Tom Rini wrote:
 
 On Sat, Nov 09, 2013 at 06:49:01PM +0100, Albert ARIBAUD wrote:
  
  Which 'not-a-diff-exactly' do you mean?
 
 Well, for example 'git show c0bb110' shows how
 arch/blackfin/cpu/Makefile was merged as a conflict I had to fixup.  The
 ' -' lines are how the blackfin tree was, the ' +' lines are how master
 was and '- ' is what came out from the blackfin side and '++' is what
 came in with my resolution (saved to master) (the '  ' lines are common
 to both).  It's not a diff exactly but it's understandable.

I would not call it not a diff exactly.  Instead I always
thought of it as two diffs in one.  You get this representation
upon 'git diff' in rebase conflicts before they are resolved as
well (which are just merges, too).

Consider the two first characters on each line as as the diff
you introduce (leftmost column) and the diff of the conflicting
upstream patch (second column).  So you can derive whether your
local change follows the upstream's direction (flows with it)
or is contrary and needs re-consideration (re-introduces what has
gone, or uses what no longer is there).

Applying this interpretation to the 'git show c0bb110' you cite
above, the upstream does s/COBJ/obj/ (plus some more) for most of
the Makefile and you do s/CONFIG_ADI_GPIO1/y/ for gpio.o, while
both changes work towards Kbuild style.  Does this mental model
of mine fit what's happening?  Or am I missing something, or
misinterpreting?


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


[U-Boot] [PATCH 16/32] sandbox: Add -i option to enter interactive mode

2013-11-10 Thread Simon Glass
Normally when U-Boot starts with a command (-c option) it quits when the
command completes. Normally this is what is requires, since the test is
likely complete.

Provide an option to jump into the console instead, so that debugging or
other tasks may be performed before quitting.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/start.c | 12 +++-
 arch/sandbox/include/asm/state.h |  2 ++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 895c4d8..579ece4 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -77,7 +77,8 @@ int sandbox_main_loop_init(void)
/* Execute command if required */
if (state-cmd) {
run_command_list(state-cmd, -1, 0);
-   os_exit(state-exit_type);
+   if (!state-interactive)
+   os_exit(state-exit_type);
}
 
return 0;
@@ -98,6 +99,15 @@ static int sandbox_cmdline_cb_fdt(struct sandbox_state 
*state, const char *arg)
 }
 SANDBOX_CMDLINE_OPT_SHORT(fdt, 'd', 1, Specify U-Boot's control FDT);
 
+static int sandbox_cmdline_cb_interactive(struct sandbox_state *state,
+ const char *arg)
+{
+   state-interactive = true;
+   return 0;
+}
+
+SANDBOX_CMDLINE_OPT_SHORT(interactive, 'i', 0, Enter interactive mode);
+
 int main(int argc, char *argv[])
 {
struct sandbox_state *state;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index a38820b..df196b79 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -7,6 +7,7 @@
 #define __SANDBOX_STATE_H
 
 #include config.h
+#include stdbool.h
 
 /* How we exited U-Boot */
 enum exit_type_id {
@@ -23,6 +24,7 @@ struct sandbox_spi_info {
 /* The complete state of the test system */
 struct sandbox_state {
const char *cmd;/* Command to execute */
+   bool interactive;   /* Enable cmdline after execute */
const char *fdt_fname;  /* Filename of FDT binary */
enum exit_type_id exit_type;/* How we exited U-Boot */
const char *parse_err;  /* Error to report from parsing */
-- 
1.8.4.1

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


Re: [U-Boot] [PATCH v6 07/17] dm: Add README for driver model

2013-11-10 Thread Gerhard Sittig
On Thu, Nov 07, 2013 at 09:32 -0700, Simon Glass wrote:
 
 +Declaring Drivers
 +-
 +
 +A driver declaration looks something like this (see
 +drivers/demo/demo-shape.c):
 +
 +static const struct demo_ops simple_ops = {
 + .hello = shape_hello,
 + .status = shape_status,
 +};
 +
 +U_BOOT_DRIVER(demo_shape_drv) = {
 + .name   = demo_shape_drv,
 + .id = UCLASS_DEMO,
 + .ops= simple_ops,
 + .priv_data_size = sizeof(struct shape_data),
 +};

Should the variable 'simple_ops' be named 'shape_ops' or
'demo_shape_ops', to better reflect that it's the list of
operations for the 'shape' driver which implements the 'demo'
class API?  Because 'simple' is found nowhere else in this
example.


 +Things to punt for later
 +
 +
 [ ... ]
 +
 +For pre-relocation we can simply call the driver model init function. Then
 +post relocation we throw that away and re-init driver model again. For 
 drivers
 +which require some sort of continuity between pre- and post-relocation
 +devices, we can provide access to the pre-relocatoin device pointers.

s/relocatoin/relocation/


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


Re: [U-Boot] [PATCH v6 07/17] dm: Add README for driver model

2013-11-10 Thread Gerhard Sittig
On Thu, Nov 07, 2013 at 09:32 -0700, Simon Glass wrote:
 
 +Terminology
 +---
 +
 +Uclass - a group of device which operate in the same way. A uclass provides

s/device/devices/?

 +What is going on?
 +-
 +
 +Let's start at the top. The demo command is in common/cmd_demo.c. It does
 +the usual command procesing and then:
 +
 + struct device *demo_dev;
 +
 + ret = uclass_get_device(UCLASS_DEMO, devnum, demo_dev);

Ah, your adding 'devnum' to the routine's signature resolved a
lot of the confusion I had after looking at the previous version
of the document. :)  Sorry for not sending my feedback in time.


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


Re: [U-Boot] [PATCH v2 05/18] pcnet: enable the NOUFLO feature

2013-11-10 Thread Marek Vasut
Dear Paul Burton,

 On relatively slow boards (such as the MIPS Malta with an FPGA core
 card) it can be extremely common for transmits to underflow - to the
 point where it appears they simply do not work at all. Setting the
 NOUFLO bit causes the ethernet controller to not begin transmission on
 the wire until a transmit start point is reached. Setting that transmit
 start point to the full packet will cause the controller to only
 transmit the packet once it has buffered it entirely thus preventing any
 transmit underflows from occuring and allowing the controller to
 function on slower boards.
 
 Signed-off-by: Paul Burton paul.bur...@imgtec.com
 ---
 Changes in v2:
   - rebase atop master
 ---
  drivers/net/pcnet.c | 15 +++
  1 file changed, 15 insertions(+)
 
 diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
 index 7b87660..5b248be 100644
 --- a/drivers/net/pcnet.c
 +++ b/drivers/net/pcnet.c
 @@ -312,6 +312,21 @@ static int pcnet_init(struct eth_device *dev, bd_t
 *bis) pcnet_write_bcr(dev, 32, val);
 
   /*
 +  * Enable NOUFLO on supported controllers, with the transmit
 +  * start point set to the full packet. This will cause entire
 +  * packets to be buffered by the ethernet controller before
 +  * transmission, eliminating underflows which are common on
 +  * slower devices. Controllers which do not support NOUFLO will
 +  * simply be left with a larger transmit FIFO threshold.
 +  */
 + val = pcnet_read_bcr(dev, 18);
 + val |= 1  11;
 + pcnet_write_bcr(dev, 18, val);
 + val = pcnet_read_csr(dev, 80);
 + val |= 0x3  10;
 + pcnet_write_csr(dev, 80, val);

Would be nice to fix this so we don't have so many magic numbers there.

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 16/18] malta: setup PIIX4 interrupt route

2013-11-10 Thread Marek Vasut
Dear Paul Burton,

 Without setting up the PIRQ[A:D] interrupt routes, PCI interrupts will
 be left disabled. Linux does not set up this routing but relies upon it
 having been set up by the bootloader, reading back the IRQ lines which
 the PIRQ[A:D] signals have been routed to.

Did you also submit a fix to Linux guys?

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 v4 1/8] Implement autoconf header file

2013-11-10 Thread Marek Vasut
Dear Simon Glass,

 Add support for generating an autoconf.h header file that can be used in
 the source instead of #ifdef.
 
 For example, instead of:
 
  #ifdef CONFIG_VERSION_VARIABLE
   setenv(ver, version_string);  /* set version variable */
  #endif

I hope this has nothing to do with autoconf(1) .

[...]

 +# The file is regenerated when any U-Boot header file changes.
 +$(obj)include/generated/autoconf.h: $(obj)include/config.h
 + @$(XECHO) Generating $@ ; \
 + set -e ; \
 + : Extract the config macros to a C header file ; \
 + $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
 + sed -n -f tools/scripts/define2value.sed  $@.tmp; \
 + : Regenerate our list of all config macros if neeed ; \
 + if [ ! -f $@-all.tmp ] || \
 + find $(src) -name '*.h' -type f -newer $@-all.tmp | \
 + egrep -qv 'include/(autoconf.h|generated|config.h)'; \
 + then \
 + : Extract all config macros from all C header files ; \
 + : We can grep for CONFIG since the value will be dropped ; \
 + ( \
 + find ${src} -name *.h -type f | xargs \
 + cat | grep CONFIG | \
 + sed -n -f tools/scripts/define2zero.sed \

Won't find ... -exec grep CONFIG \; | sed ... work here and drop some extra 
overhead ?

 + ) | sort | uniq  $@-all.tmp; \

sort -u maybe ?

 + fi; \
 + : Extract the enabled config macros to a C header file ; \
 + $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
 + sed -n -f tools/scripts/define2zero.sed | \
 + sort  $@-enabled.tmp; \
 + set -e ; \
 + : Find CONFIGs that are not enabled ; \
 + comm -13 $@-enabled.tmp $@-all.tmp $@.tmp  \
 + mv $@.tmp $@

[...]

 diff --git a/tools/scripts/define2value.sed
 b/tools/scripts/define2value.sed new file mode 100644
 index 000..205f9fe
 --- /dev/null
 +++ b/tools/scripts/define2value.sed
 @@ -0,0 +1,37 @@
 +#
 +# Sed script to parse CPP macros and generate a list of CONFIG macros
 +#
 +# This converts:
 +##define CONFIG_XXX value
 +#into:
 +##define autoconf_xxx() value
 +##define autoconf_has_xxx() 1
 +
 +# Macros with parameters are ignored.
 +# (Note we avoid + since it doesn't appear to work)
 +/^#define CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*(/ {
 + d
 +}
 +
 +# Only process values prefixed with #define CONFIG_
 +/^#define CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*/ {

You might want to adjust it this way:

/^[[:blank:]]\+#define[[:blank:]]\+[[:alnum:]_]\+/

This will pick #defines prefixed and suffixed with arbitrary amount of 
whitespace.

 + # Strip the #define prefix
 + s/#define[ \t]*CONFIG_/autoconf_/;

This will pick #defineCONFIG . Maybe #define[[:blank:]]\+

 + # Change to form CONFIG_*=VALUE
 + s/[\t ][\t ]*/=/;
 + # Handle lines with no value
 + s/^\([^=]*\)$/\1=/;

I wonder, how will this handle lines like:

include/configs/yucca.h:#define CONFIG_SYS_FLASH_WORD_SIZE  unsigned char

or

include/configs/at91sam9m10g45ek.h:#define CONFIG_SYS_PROMPT
U-Boot 


or

#define CONFIG_FOO \
value_is_bar \
another_value_quux

?

 + # Drop trailing spaces
 + s/ *$//;
 + # Change empty values to '1'
 + s/=$/=1/;
 + # Add #define at the start
 + s/^\([^=]*\)=/#define \L\1() /
 + # print the line
 + p
 + # Create autoconf_has_...(), value 1
 + s/().*/() 1/
 + s/\(autoconf_\)/\1has_/
 + # print the line
 + p
 +}

I'm tempted to rework this as a one-liner, but please stop me if you consider 
that worthless.
[...]
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/18] malta: support for coreFPGA6 boards

2013-11-10 Thread Marek Vasut
Dear Paul Burton,

 This patch adds support for running on Malta boards using coreFPGA6
 core cards, including support for the msc01 system controller used
 with them. The system controller is detected at runtime allowing one
 U-boot binary to run on a Malta with either.
 
 Due to the PCI I/O base differing between Maltas using gt64120  msc01
 system controllers, the UART setup is modified slightly. A second UART
 is added so that there is one pointing at the correct address for each
 system controller. The Malta board then defines its own
 default_serial_console function to select the correct one at runtime.
 The incorrect UART will simply not function.
 
 Tested on:
   - A coreFPGA6 Malta running interAptiv and proAptiv bitstreams, both
 with and without an L2 cache.
   - QEMU.
 
 Signed-off-by: Paul Burton paul.bur...@imgtec.com
 ---
 Changes in v3:
   - rebase atop master
   - remove commit message note about not working in QEMU, this does work
 in older QEMU versions as noted by Gabor Juhos
 
 Changes in v2:
   - rebased after malta moved to board/imgtec/malta
   - removed unused status variable from msc01_config_access
 ---
  arch/mips/include/asm/malta.h  |  35 ++--
  board/imgtec/malta/lowlevel_init.S | 164
 - board/imgtec/malta/malta.c |
 126 ++-- drivers/pci/Makefile   |   1
 +
  drivers/pci/pci_msc01.c| 125 
  include/configs/malta.h|   4 +-
  include/msc01.h| 135 ++
  include/pci_ids.h  |   3 +
  include/pci_msc01.h|  17 
  9 files changed, 594 insertions(+), 16 deletions(-)
  create mode 100644 drivers/pci/pci_msc01.c
  create mode 100644 include/msc01.h
  create mode 100644 include/pci_msc01.h
 
 diff --git a/arch/mips/include/asm/malta.h b/arch/mips/include/asm/malta.h
 index d4d44a2..0b50a66 100644
 --- a/arch/mips/include/asm/malta.h
 +++ b/arch/mips/include/asm/malta.h

You are missing license in some files.

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 v5 07/18] qemu-malta: rename to just malta

2013-11-10 Thread Marek Vasut
Dear Paul Burton,

 This is in preparation for adapting this board to function correctly on
 a physical MIPS Malta board. The board is moved into an imgtec vendor
 directory at the same time in order to ready us for any other boards
 supported by Imagination in the future.
 
 Signed-off-by: Paul Burton paul.bur...@imgtec.com

Will the board still work in QEMU?

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 08/18] malta: setup super I/O UARTs

2013-11-10 Thread Marek Vasut
Dear Paul Burton,

 On a real Malta the Super I/O needs to be configured before we are able
 to access the UARTs. This patch performs that configuration, setting up
 the UARTs in the same way that YAMON would.

[...]

 --- /dev/null
 +++ b/board/imgtec/malta/superio.c

Do we not already have some kind of a superIO controller driver in U-Boot ? 
Just 
wondering, I seem to remember seeing a few. Is this driver re-usable by other 
boards too maybe?

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 10/18] malta: display U-boot on the LCD screen

2013-11-10 Thread Marek Vasut
Dear Paul Burton,

 Displaying a message on the LCD screen is a simple yet effective way to
 show the user that the board has booted successfully.
 
 Signed-off-by: Paul Burton paul.bur...@imgtec.com
 ---
 Changes in v3:
   - rebase atop master
 
 Changes in v2:
   - rebased after malta moved to board/imgtec/malta
 ---
  arch/mips/include/asm/malta.h | 10 ++
  board/imgtec/malta/malta.c| 19 +++
  2 files changed, 29 insertions(+)
 
 diff --git a/arch/mips/include/asm/malta.h b/arch/mips/include/asm/malta.h
 index 0b50a66..d8ec57c 100644
 --- a/arch/mips/include/asm/malta.h
 +++ b/arch/mips/include/asm/malta.h
 @@ -32,6 +32,16 @@
  #define MALTA_MSC01_PCIIO_MAP0x
  #define MALTA_MSC01_UART0_BASE   (MALTA_MSC01_PCIIO_BASE + 0x3f8)
 
 +#define MALTA_ASCIIWORD  0x1f000410
 +#define MALTA_ASCIIPOS0  0x1f000418
 +#define MALTA_ASCIIPOS1  0x1f000420
 +#define MALTA_ASCIIPOS2  0x1f000428
 +#define MALTA_ASCIIPOS3  0x1f000430
 +#define MALTA_ASCIIPOS4  0x1f000438
 +#define MALTA_ASCIIPOS5  0x1f000440
 +#define MALTA_ASCIIPOS6  0x1f000448
 +#define MALTA_ASCIIPOS7  0x1f000450
 +
  #define MALTA_RESET_BASE 0x1f000500
  #define GORESET  0x42
 
 diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c
 index 2af0067..119546a 100644
 --- a/board/imgtec/malta/malta.c
 +++ b/board/imgtec/malta/malta.c
 @@ -29,6 +29,24 @@ enum sys_con {
   SYSCON_MSC01,
  };
 
 +static void malta_lcd_puts(const char *str)
 +{
 + int i;
 + void *reg = (void *)CKSEG1ADDR(MALTA_ASCIIPOS0);
 +
 + /* print up to 8 characters of the string */
 + for (i = 0; i  min(strlen(str), 8); i++) {
 + __raw_writel(str[i], reg);
 + reg += MALTA_ASCIIPOS1 - MALTA_ASCIIPOS0;
 + }
 +
 + /* fill the rest of the display with spaces */
 + for (; i  8; i++) {
 + __raw_writel(' ', reg);
 + reg += MALTA_ASCIIPOS1 - MALTA_ASCIIPOS0;
 + }
 +}
 +
  static enum core_card malta_core_card(void)
  {
   u32 corid, rev;
 @@ -71,6 +89,7 @@ int checkboard(void)
  {
   enum core_card core;
 
 + malta_lcd_puts(U-boot);
   puts(Board: MIPS Malta);
 
   core = malta_core_card();

Can this not be implemented as a regular framebuffer console maybe?

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


[U-Boot] [PATCH v2] configs: clean up unused macro CONFIG_L2_OFF

2013-11-10 Thread Masahiro Yamada
Since commit c2dd0d455 and 45bf05854 introduced
the new cache maintainance framework to ARM,
CONFIG_L2_OFF has not been used at all.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
Changes in v2:
  - fix commit log

 include/configs/highbank.h | 1 -
 include/configs/kzm9g.h| 1 -
 include/configs/mx51_efikamx.h | 1 -
 include/configs/origen.h   | 2 --
 include/configs/smdkv310.h | 3 ---
 include/configs/snowball.h | 1 -
 include/configs/socfpga_cyclone5.h | 1 -
 include/configs/u8500_href.h   | 1 -
 8 files changed, 11 deletions(-)

diff --git a/include/configs/highbank.h b/include/configs/highbank.h
index b86eb43..7dbee3c 100644
--- a/include/configs/highbank.h
+++ b/include/configs/highbank.h
@@ -8,7 +8,6 @@
 #define __CONFIG_H
 
 #define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_L2_OFF
 #define CONFIG_SYS_THUMB_BUILD
 
 #define CONFIG_SYS_NO_FLASH
diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h
index 1afd487..0359e9b 100644
--- a/include/configs/kzm9g.h
+++ b/include/configs/kzm9g.h
@@ -22,7 +22,6 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_L2_OFF
 #define CONFIG_OF_LIBFDT
 
 #include config_cmd_default.h
diff --git a/include/configs/mx51_efikamx.h b/include/configs/mx51_efikamx.h
index 8a44ef5..0f2a4ef 100644
--- a/include/configs/mx51_efikamx.h
+++ b/include/configs/mx51_efikamx.h
@@ -29,7 +29,6 @@
 
 #define CONFIG_SYS_TEXT_BASE   0x9780
 
-#defineCONFIG_L2_OFF
 #defineCONFIG_SYS_ICACHE_OFF
 #defineCONFIG_SYS_DCACHE_OFF
 
diff --git a/include/configs/origen.h b/include/configs/origen.h
index bad34b3..f46b833 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -22,8 +22,6 @@
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_BOARD_EARLY_INIT_F
 
-/* Keep L2 Cache Disabled */
-#define CONFIG_L2_OFF  1
 #define CONFIG_SYS_DCACHE_OFF  1
 
 #define CONFIG_SYS_SDRAM_BASE  0x4000
diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h
index e2e8efe..1388f49 100644
--- a/include/configs/smdkv310.h
+++ b/include/configs/smdkv310.h
@@ -25,9 +25,6 @@
 /* Mach Type */
 #define CONFIG_MACH_TYPE   MACH_TYPE_SMDKV310
 
-/* Keep L2 Cache Disabled */
-#define CONFIG_L2_OFF  1
-
 #define CONFIG_SYS_SDRAM_BASE  0x4000
 #define CONFIG_SYS_TEXT_BASE   0x43E0
 
diff --git a/include/configs/snowball.h b/include/configs/snowball.h
index 00d6fa5..9a069f3 100644
--- a/include/configs/snowball.h
+++ b/include/configs/snowball.h
@@ -23,7 +23,6 @@
  * (easy to change)
  */
 #define CONFIG_U8500
-#define CONFIG_L2_OFF
 
 #define CONFIG_SYS_MEMTEST_START   0x
 #define CONFIG_SYS_MEMTEST_END 0x1FFF
diff --git a/include/configs/socfpga_cyclone5.h 
b/include/configs/socfpga_cyclone5.h
index 980636c..608578a 100644
--- a/include/configs/socfpga_cyclone5.h
+++ b/include/configs/socfpga_cyclone5.h
@@ -16,7 +16,6 @@
 #define CONFIG_SOCFPGA_VIRTUAL_TARGET
 
 #define CONFIG_ARMV7
-#define CONFIG_L2_OFF
 #define CONFIG_SYS_DCACHE_OFF
 #undef CONFIG_USE_IRQ
 
diff --git a/include/configs/u8500_href.h b/include/configs/u8500_href.h
index 45d33a6..629299d 100644
--- a/include/configs/u8500_href.h
+++ b/include/configs/u8500_href.h
@@ -12,7 +12,6 @@
  * (easy to change)
  */
 #define CONFIG_U8500
-#define CONFIG_L2_OFF
 
 #define CONFIG_SYS_MEMTEST_START   0x
 #define CONFIG_SYS_MEMTEST_END 0x1FFF
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH] configs: clean up unused macro CONFIG_L2_OFF

2013-11-10 Thread Masahiro Yamada

 Since commit c2dd0d455 and 45bf05854 introduced
 the new cache maintainance framework to ARM,
 CONFIG_L2_OFF has been used at all.

Commit log was wrong.

s/has been used/has not been used/

I posted v2 with corrected commit log.



Best Regards
Masahiro Yamada

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


Re: [U-Boot] [U-boot] uboot support ext4 format command?

2013-11-10 Thread TigerLiu
Hi, Albert:
I don't think it does, but you can find out by looking at the
documentation and code.

Besides, I don't think being able to format a filesystem from
the bootloader is really needed; this task is best performed in a
full-fledged operating system IMO. 

I aslo don't think uboot need a ext4 format tool.
From the code implementation, it also didn't implement format function.

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


Re: [U-Boot] [PATCH 3/3] gpio_led: add support for inverted polarity

2013-11-10 Thread Otavio Salvador
On Thu, Nov 7, 2013 at 9:03 PM, Igor Grinberg grinb...@compulab.co.il wrote:
 Some GPIO connected LEDs have inverted polarity.
 Introduce new config option: CONFIG_GPIO_LED_INVERTED_TABLE for the
 specifying the inverted GPIO LEDs list and add support for this in the
 gpio_led driver.

 Signed-off-by: Igor Grinberg grinb...@compulab.co.il

Neat; I will test this in the board I have same situation and see if
it works for my case fully but this seems to be a lean and simply
solution for the issue.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: cogent: include header files in a more natural way

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
Note:
I built cogent_mpc8260 and cogent_mpc8xx boards
and confirmed that the same binaries were still generated
with the changes in this commit.

 board/cogent/config.mk | 12 
 board/cogent/dipsw.c   |  2 +-
 board/cogent/flash.c   |  2 +-
 board/cogent/lcd.c |  2 +-
 board/cogent/mb.c  | 10 +-
 board/cogent/serial.c  |  2 +-
 6 files changed, 9 insertions(+), 21 deletions(-)
 delete mode 100644 board/cogent/config.mk

diff --git a/board/cogent/config.mk b/board/cogent/config.mk
deleted file mode 100644
index 1452d46..000
--- a/board/cogent/config.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# (C) Copyright 2000
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-#
-# Cogent Modular Architecture
-#
-
-PLATFORM_CPPFLAGS += -I$(TOPDIR)
diff --git a/board/cogent/dipsw.c b/board/cogent/dipsw.c
index d2027c9..ecfbc25 100644
--- a/board/cogent/dipsw.c
+++ b/board/cogent/dipsw.c
@@ -1,5 +1,5 @@
 #include common.h
-#include board/cogent/dipsw.h
+#include dipsw.h
 
 unsigned char
 dipsw_raw(void)
diff --git a/board/cogent/flash.c b/board/cogent/flash.c
index d4ae4d0..1da8f10 100644
--- a/board/cogent/flash.c
+++ b/board/cogent/flash.c
@@ -6,7 +6,7 @@
  */
 
 #include common.h
-#include board/cogent/flash.h
+#include flash.h
 #include linux/compiler.h
 
 flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips 
*/
diff --git a/board/cogent/lcd.c b/board/cogent/lcd.c
index 76f5ad1..8e90f98 100644
--- a/board/cogent/lcd.c
+++ b/board/cogent/lcd.c
@@ -48,7 +48,7 @@
 
 #include common.h
 #include stdarg.h
-#include board/cogent/lcd.h
+#include lcd.h
 
 static char lines[2][LCD_LINE_LENGTH+1];
 static int curline;
diff --git a/board/cogent/mb.c b/board/cogent/mb.c
index 603f123..3eea47d 100644
--- a/board/cogent/mb.c
+++ b/board/cogent/mb.c
@@ -6,11 +6,11 @@
  */
 
 #include common.h
-#include board/cogent/dipsw.h
-#include board/cogent/lcd.h
-#include board/cogent/rtc.h
-#include board/cogent/par.h
-#include board/cogent/pci.h
+#include dipsw.h
+#include lcd.h
+#include rtc.h
+#include par.h
+#include pci.h
 
 /* - */
 
diff --git a/board/cogent/serial.c b/board/cogent/serial.c
index 20631d1..f0d6b22 100644
--- a/board/cogent/serial.c
+++ b/board/cogent/serial.c
@@ -4,7 +4,7 @@
  */
 
 #include common.h
-#include board/cogent/serial.h
+#include serial.h
 #include serial.h
 #include linux/compiler.h
 
-- 
1.8.3.2

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


Re: [U-Boot] Question about patman

2013-11-10 Thread Masahiro Yamada
Hello Albert.

 I have posted a patch to allow adding notes below the '---' line, if
 this is what you mean. So far, there was no comment on it. See:
 
 http://patchwork.ozlabs.org/patch/283057/

Yeah!
This is the function exactly I have wanted.

Thank you.

Beat Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH 3/4] arm: rmobile: Add support R8A7791

2013-11-10 Thread Nobuhiro Iwamatsu
Hi,

OK. I removed unused defines from code.
I already resend updarted patches.

Could you check these?

Best regards,
  Nobuhirio

2013/11/5 Albert ARIBAUD albert.u.b...@aribaud.net:
 Hi Nobuhiro,

 On Thu, 31 Oct 2013 17:18:54 +0900, Nobuhiro Iwamatsu
 nobuhiro.iwamatsu...@renesas.com wrote:

 Hi, again.

 2013/10/31 Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com:
  Hi, Albert.
 
  Sorry, I dont notice your mail.
 
  2013/10/30 Albert ARIBAUD albert.u.b...@aribaud.net:
  On Thu, 17 Oct 2013 13:04:06 +0200, Albert ARIBAUD
  albert.u.b...@aribaud.net wrote:
 
  Hi Nobuhiro,
 
  On Tue, 24 Sep 2013 15:38:34 +0900, Nobuhiro Iwamatsu
  nobuhiro.iwamatsu...@renesas.com wrote:
 
   Renesas R8A7791 is CPU with Cortex-A7 and A15.
   This supports the basic register definition and GPIO and
   framework of PFC.
  
   Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
   Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
   CC: Nobuhiro Iwamatsu iwama...@nigauri.org
   CC: Albert Aribaud albert.u.b...@aribaud.net
   ---
arch/arm/cpu/armv7/rmobile/Makefile  |2 +
arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c|   29 +
arch/arm/cpu/armv7/rmobile/cpu_info.c|5 +
arch/arm/cpu/armv7/rmobile/pfc-r8a7791.c | 3415 
   ++
 
  Is there no way to make this big file common between R8A7790 and
  R8A7791?
 
  Thanks for your comment.
 
  Sorry, do you mean that  Can you common the  PFC of r8a7790 and
  r8a7791?, because this file is large and
  these can be used in common.
  Right?
 
  If this is right, I will merge these file and re-send.
 

 I tried common  between R8A7790 and R8A7791.
 But these files have  register infomation of Pin Function Controller.
 Register configuration is different from these, there is almost no common 
 parts.
 However, I found a common part of some. It is possible to separate them.

 If this can reduce the overall source code size, please do so.

 Best regards,
Nobuhiro

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



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


[U-Boot] patman drops Cc tag

2013-11-10 Thread Masahiro Yamada
Hello.

It seems patman deletes Cc: tag
when it generating a patch file.
Is this a bug or a spec?

I want Cc: tag not to be touched by patman.

Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] nios2: remove unnecessary header include path

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Thomas Chou tho...@wytron.com.tw
---

Note:
I built all of nios2 boards and confirmed that the same binaries
were still generated with the changes in this commit.

 board/altera/nios2-generic/config.mk | 4 
 board/psyent/pci5441/config.mk   | 1 -
 board/psyent/pk1c20/config.mk| 1 -
 3 files changed, 6 deletions(-)

diff --git a/board/altera/nios2-generic/config.mk 
b/board/altera/nios2-generic/config.mk
index f9f317c..a673525 100644
--- a/board/altera/nios2-generic/config.mk
+++ b/board/altera/nios2-generic/config.mk
@@ -5,11 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-# we get text_base from board config header, so do not use this
-#CONFIG_SYS_TEXT_BASE = do-not-use-me
-
 PLATFORM_CPPFLAGS += -mno-hw-div -mno-hw-mul
-PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(VENDOR)/include
 
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
diff --git a/board/psyent/pci5441/config.mk b/board/psyent/pci5441/config.mk
index 00ff743..776fa8a 100644
--- a/board/psyent/pci5441/config.mk
+++ b/board/psyent/pci5441/config.mk
@@ -8,7 +8,6 @@
 CONFIG_SYS_TEXT_BASE = 0x018e
 
 PLATFORM_CPPFLAGS += -mno-hw-div -mno-hw-mul
-PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(VENDOR)/include
 
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
diff --git a/board/psyent/pk1c20/config.mk b/board/psyent/pk1c20/config.mk
index 7b0810a..83cfadc 100644
--- a/board/psyent/pk1c20/config.mk
+++ b/board/psyent/pk1c20/config.mk
@@ -8,7 +8,6 @@
 CONFIG_SYS_TEXT_BASE = 0x01fc
 
 PLATFORM_CPPFLAGS += -mno-hw-div -mno-hw-mul
-PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(VENDOR)/include
 
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
-- 
1.8.3.2

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


[U-Boot] [PATCH] cosmetic: README.scrapyard: Add eNET board

2013-11-10 Thread Masahiro Yamada
Commit 7e8c53d7 removed eNET board but missed to
add eNET to README.scrapyard.
This commit adds it for the record.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Simon Glass s...@chromium.org
Cc: Graeme Russ graeme.r...@gmail.com
---
 doc/README.scrapyard | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/README.scrapyard b/doc/README.scrapyard
index 7cfb3a3..00bf61f 100644
--- a/doc/README.scrapyard
+++ b/doc/README.scrapyard
@@ -100,3 +100,4 @@ CPCI440  powerpc 440GP  b568fd2 
2007-12-27  Matthias Fuc
 PCIPPC2  powerpc MPC740/MPC750  7c9e89b 2013-02-07  Wolfgang 
Denk w...@denx.de
 PCIPPC6  powerpc MPC740/MPC750  -   -   Wolfgang 
Denk w...@denx.de
 omap2420h4   arm omap24xx   -   2013-06-04  Richard 
Woodruff r-woodru...@ti.com
+eNET x86 x867e8c53d 2013-02-14  Graeme 
Russ graeme.r...@gmail.com
-- 
1.8.3.2

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


[U-Boot] [PATCH] examples: remove the remainders of dead board

2013-11-10 Thread Masahiro Yamada
Commit 309a292e deleted OXC board, but
missed to remove the standalone example specific to OXC board.

eepro100_eeprom.c has been an orphan file for a long term.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 examples/standalone/Makefile  |   4 +-
 examples/standalone/eepro100_eeprom.c | 214 --
 2 files changed, 1 insertion(+), 217 deletions(-)
 delete mode 100644 examples/standalone/eepro100_eeprom.c

diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 4afedea..9346921 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -8,7 +8,6 @@
 include $(TOPDIR)/config.mk
 
 ELF-$(ARCH)  :=
-ELF-$(BOARD) :=
 ELF-$(CPU)   :=
 ELF-y:= hello_world
 
@@ -20,14 +19,13 @@ ELF-mpc5xxx  += interrupt
 ELF-mpc8xx   += test_burst timer
 ELF-mpc8260  += mem_to_mem_idma2intr
 ELF-ppc  += sched
-ELF-oxc  += eepro100_eeprom
 
 #
 # Some versions of make do not handle trailing white spaces properly;
 # leading to build failures. The problem was found with GNU Make 3.80.
 # Using 'strip' as a workaround for the problem.
 #
-ELF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)))
+ELF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(CPU)))
 
 SREC := $(addsuffix .srec,$(ELF))
 BIN  := $(addsuffix .bin,$(ELF))
diff --git a/examples/standalone/eepro100_eeprom.c 
b/examples/standalone/eepro100_eeprom.c
deleted file mode 100644
index 3c7f380..000
--- a/examples/standalone/eepro100_eeprom.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright 1998-2001 by Donald Becker.
- * This software may be used and distributed according to the terms of
- * the GNU General Public License (GPL), incorporated herein by reference.
- * Contact the author for use under other terms.
- *
- * This program must be compiled with -O!
- * See the bottom of this file for the suggested compile-command.
- *
- * The author may be reached as bec...@scyld.com, or C/O
- *  Scyld Computing Corporation
- *  410 Severn Ave., Suite 210
- *  Annapolis MD 21403
- *
- * Common-sense licensing statement: Using any portion of this program in
- * your own program means that you must give credit to the original author
- * and release the resulting code under the GPL.
- */
-
-/* avoid unnecessary memcpy function */
-#define _PPC_STRING_H_
-
-#include common.h
-#include exports.h
-
-static int reset_eeprom(unsigned long ioaddr, unsigned char *hwaddr);
-
-int eepro100_eeprom(int argc, char * const argv[])
-{
-   int ret = 0;
-
-   unsigned char hwaddr1[6] = { 0x00, 0x00, 0x02, 0x03, 0x04, 0x05 };
-   unsigned char hwaddr2[6] = { 0x00, 0x00, 0x02, 0x03, 0x04, 0x06 };
-
-   app_startup(argv);
-
-#if defined(CONFIG_OXC)
-   ret |= reset_eeprom(0x8000, hwaddr1);
-   ret |= reset_eeprom(0x8100, hwaddr2);
-#endif
-
-   return ret;
-}
-
-/* Default EEPROM for i82559 */
-static unsigned short default_eeprom[64] = {
-   0x0100, 0x0302, 0x0504, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x40c0, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x,
-   0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x
-};
-
-static unsigned short eeprom[256];
-
-static int eeprom_size = 64;
-static int eeprom_addr_size = 6;
-
-static int debug = 0;
-
-static inline unsigned short swap16(unsigned short x)
-{
-   return (((x  0xff)  8) | ((x  0xff00)  8));
-}
-
-static inline void outw(short data, long addr)
-{
-   *(volatile short *)(addr) = swap16(data);
-}
-
-static inline short inw(long addr)
-{
-   return swap16(*(volatile short *)(addr));
-}
-
-void *memcpy(void *dst, const void *src, unsigned int len)
-{
-   char *ret = dst;
-   while (len--  0) {
-   *ret++ = *((char *)src);
-   src++;
-   }
-   return (void *)ret;
-}
-
-/* The EEPROM commands include the alway-set leading bit. */
-#define EE_WRITE_CMD   (5)
-#define EE_READ_CMD(6)
-#define EE_ERASE_CMD   (7)
-
-/* Serial EEPROM section. */
-#define EE_SHIFT_CLK   0x01/* EEPROM shift clock. */
-#define EE_CS  0x02/* EEPROM chip select. */
-#define EE_DATA_WRITE  0x04/* EEPROM chip data in. */
-#define EE_DATA_READ   0x08/* EEPROM chip data out. */
-#define EE_ENB (0x4800 | EE_CS)
-#define EE_WRITE_0 0x4802
-#define EE_WRITE_1 0x4806
-#define EE_OFFSET  14
-
-/* Delay between EEPROM clock transitions. */
-#define eeprom_delay(ee_addr)  inw(ee_addr)
-
-/* Wait for 

[U-Boot] [PATCH] examples: add again x86 standalone example

2013-11-10 Thread Masahiro Yamada
Commit fea25720 renamed arch/i386 to arch/x86.
But it missed to modify examples/standalone/Makefile.

This commit revives examples/standalone/82559_eeprom.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Simon Glass s...@chromium.org
---

Hello, Simon.

I think examples/standalone/82559_eeprom should have been
originally implemented for i386(x86) architecture
but it has never compiled more than two years.
(And I am probably the first one to notice this.)

I chosed to add it again rather than delete it in this patch.
If you do not need it any more, I am glad to re-post v2
to delete it.

 examples/standalone/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 9346921..237b737 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -14,7 +14,7 @@ ELF-y:= hello_world
 ELF-$(CONFIG_SMC9)   += smc9_eeprom
 ELF-$(CONFIG_SMC911X)+= smc911x_eeprom
 ELF-$(CONFIG_SPI_FLASH_ATMEL)+= atmel_df_pow2
-ELF-i386 += 82559_eeprom
+ELF-x86  += 82559_eeprom
 ELF-mpc5xxx  += interrupt
 ELF-mpc8xx   += test_burst timer
 ELF-mpc8260  += mem_to_mem_idma2intr
-- 
1.8.3.2

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


[U-Boot] [U-boot] not support parsing Android's boot.img format ?

2013-11-10 Thread TigerLiu
Hi, experts:

It seems current uboot does not support parse boot.img which saved in
NAND chip.

Boot.img contains : kernel.img and ramdisk.img

It contains a header struct:

struct boot_img_hdr

{

unsigned char magic[BOOT_MAGIC_SIZE];

 

unsigned kernel_size;  /* size in bytes */

unsigned kernel_addr;  /* physical load addr */

 

unsigned ramdisk_size; /* size in bytes */

unsigned ramdisk_addr; /* physical load addr */

 

unsigned second_size;  /* size in bytes */

unsigned second_addr;  /* physical load addr */

 

unsigned tags_addr;/* physical addr for kernel tags */

unsigned page_size;/* flash page size we assume */

unsigned unused[2];/* future expansion: should be 0 */

 

unsigned char name[BOOT_NAME_SIZE]; /* asciiz product name */



unsigned char cmdline[BOOT_ARGS_SIZE];

 

unsigned id[8]; /* timestamp / checksum / sha1 / etc */

};

 

Nand boot cmd usually should retrieve kernel.img from boot.img.

 

Best wishes,

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


[U-Boot] [PATCH] board: Do not add -DCONFIG_SYS_TEXT_BASE in board config.mk

2013-11-10 Thread Masahiro Yamada
Board config.mk do not need to add -DCONFIG_SYS_TEXT_BASE
to CPPFLAGS because the top level config.mk does instead.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

See around line 240 of ./config.mk



ifneq ($(CONFIG_SYS_TEXT_BASE),)
CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
endif




 board/freescale/m52277evb/config.mk| 11 ---
 board/freescale/m5235evb/config.mk | 12 
 board/freescale/m54451evb/config.mk| 11 ---
 board/freescale/m54455evb/config.mk| 11 ---
 board/gaisler/gr_cpci_ax2000/config.mk |  3 +--
 board/gaisler/gr_ep2s60/config.mk  |  3 +--
 board/gaisler/gr_xc3s_1500/config.mk   |  3 +--
 board/gaisler/grsim/config.mk  |  3 +--
 board/gaisler/grsim_leon2/config.mk|  3 +--
 9 files changed, 5 insertions(+), 55 deletions(-)
 delete mode 100644 board/freescale/m52277evb/config.mk
 delete mode 100644 board/freescale/m5235evb/config.mk
 delete mode 100644 board/freescale/m54451evb/config.mk
 delete mode 100644 board/freescale/m54455evb/config.mk

diff --git a/board/freescale/m52277evb/config.mk 
b/board/freescale/m52277evb/config.mk
deleted file mode 100644
index 0ffb0a2..000
--- a/board/freescale/m52277evb/config.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# (C) Copyright 2000-2003
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-# Coldfire contribution by Bernhard Kuhn bk...@metrowerks.com
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
diff --git a/board/freescale/m5235evb/config.mk 
b/board/freescale/m5235evb/config.mk
deleted file mode 100644
index 9ab4582..000
--- a/board/freescale/m5235evb/config.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# (C) Copyright 2000-2003
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-# Coldfire contribution by Bernhard Kuhn bk...@metrowerks.com
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-/*CONFIG_SYS_TEXT_BASE = 0xFFC0*/
-sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
diff --git a/board/freescale/m54451evb/config.mk 
b/board/freescale/m54451evb/config.mk
deleted file mode 100644
index 0ffb0a2..000
--- a/board/freescale/m54451evb/config.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# (C) Copyright 2000-2003
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-# Coldfire contribution by Bernhard Kuhn bk...@metrowerks.com
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
diff --git a/board/freescale/m54455evb/config.mk 
b/board/freescale/m54455evb/config.mk
deleted file mode 100644
index 0ffb0a2..000
--- a/board/freescale/m54455evb/config.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# (C) Copyright 2000-2003
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-# Coldfire contribution by Bernhard Kuhn bk...@metrowerks.com
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
diff --git a/board/gaisler/gr_cpci_ax2000/config.mk 
b/board/gaisler/gr_cpci_ax2000/config.mk
index e9c6028..309c879 100644
--- a/board/gaisler/gr_cpci_ax2000/config.mk
+++ b/board/gaisler/gr_cpci_ax2000/config.mk
@@ -18,5 +18,4 @@ CONFIG_SYS_TEXT_BASE = 0x
 # U-BOOT IN SDRAM
 #CONFIG_SYS_TEXT_BASE = 0x6000
 
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-   -I$(TOPDIR)/board
+PLATFORM_CPPFLAGS += -I$(TOPDIR)/board
diff --git a/board/gaisler/gr_ep2s60/config.mk 
b/board/gaisler/gr_ep2s60/config.mk
index 6c31a17..d57efae 100644
--- a/board/gaisler/gr_ep2s60/config.mk
+++ b/board/gaisler/gr_ep2s60/config.mk
@@ -16,5 +16,4 @@ CONFIG_SYS_TEXT_BASE = 0x
 # U-BOOT IN SDRAM
 #CONFIG_SYS_TEXT_BASE = 0x4000
 
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-   -I$(TOPDIR)/board
+PLATFORM_CPPFLAGS += -I$(TOPDIR)/board
diff --git a/board/gaisler/gr_xc3s_1500/config.mk 
b/board/gaisler/gr_xc3s_1500/config.mk
index 3b59cca..e87320b 100644
--- a/board/gaisler/gr_xc3s_1500/config.mk
+++ b/board/gaisler/gr_xc3s_1500/config.mk
@@ -15,5 +15,4 @@ CONFIG_SYS_TEXT_BASE = 0x
 # U-BOOT IN RAM
 #CONFIG_SYS_TEXT_BASE = 0x4000
 
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-   -I$(TOPDIR)/board
+PLATFORM_CPPFLAGS += -I$(TOPDIR)/board
diff --git a/board/gaisler/grsim/config.mk b/board/gaisler/grsim/config.mk
index d98ed54..df26f82 100644
--- a/board/gaisler/grsim/config.mk
+++ b/board/gaisler/grsim/config.mk
@@ -15,5 +15,4 @@ CONFIG_SYS_TEXT_BASE = 0x
 # U-BOOT IN RAM
 #CONFIG_SYS_TEXT_BASE = 0x4000
 
-PLATFORM_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-   -I$(TOPDIR)/board
+PLATFORM_CPPFLAGS += -I$(TOPDIR)/board

[U-Boot] [PATCH 13/22] Makefile: refactor a little

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile | 4 +---
 spl/Makefile | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 1389ee7..e28878b 100644
--- a/Makefile
+++ b/Makefile
@@ -65,11 +65,9 @@ endif
 # the object files are placed in the source directory.
 #
 
-ifdef O
 ifeq ($(origin O), command line)
 BUILD_DIR := $(O)
 endif
-endif
 
 # Call a source code checker (by default, sparse) as part of the
 # C compilation.
@@ -614,7 +612,7 @@ SYSTEM_MAP = \
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] 
\)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
LC_ALL=C sort
 $(obj)System.map:  $(obj)u-boot
-   @$(call SYSTEM_MAP,$)  $(obj)System.map
+   @$(call SYSTEM_MAP,$)  $@
 
 checkthumb:
@if test $(call cc-version) -lt 0404; then \
diff --git a/spl/Makefile b/spl/Makefile
index 29354f9..5bc75b4 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -166,8 +166,7 @@ all:$(ALL-y)
 
 ifdef CONFIG_SAMSUNG
 $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin
-   $(OBJTREE)/tools/mk$(BOARD)spl \
-   $(obj)u-boot-spl.bin $(obj)$(BOARD)-spl.bin
+   $(OBJTREE)/tools/mk$(BOARD)spl $ $@
 endif
 
 $(obj)$(SPL_BIN).bin:  $(obj)$(SPL_BIN)
-- 
1.8.3.2

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


[U-Boot] [PATCH 06/22] Makefile: make directories by Makefile.build

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/powerpc/cpu/mpc512x/Makefile | 2 --
 arch/powerpc/cpu/mpc824x/Makefile | 4 
 board/LaCie/edminiv2/Makefile | 4 
 board/LaCie/net2big_v2/Makefile   | 4 
 board/LaCie/netspace_v2/Makefile  | 4 
 board/LaCie/wireless_space/Makefile   | 4 
 board/Marvell/db64360/Makefile| 4 
 board/Marvell/db64460/Makefile| 4 
 board/altera/nios2-generic/Makefile   | 4 
 board/avionic-design/medcom-wide/Makefile | 2 --
 board/avionic-design/plutux/Makefile  | 2 --
 board/avionic-design/tec/Makefile | 2 --
 board/compal/paz00/Makefile   | 2 --
 board/compulab/trimslice/Makefile | 2 --
 board/emk/top5200/Makefile| 4 
 board/emk/top860/Makefile | 3 ---
 board/esd/adciop/Makefile | 4 
 board/esd/apc405/Makefile | 4 
 board/esd/ar405/Makefile  | 4 
 board/esd/ash405/Makefile | 4 
 board/esd/cms700/Makefile | 4 
 board/esd/cpci2dp/Makefile| 4 
 board/esd/cpci405/Makefile| 4 
 board/esd/cpci5200/Makefile   | 4 
 board/esd/cpci750/Makefile| 4 
 board/esd/cpciiser4/Makefile  | 4 
 board/esd/dasa_sim/Makefile   | 4 
 board/esd/dp405/Makefile  | 4 
 board/esd/du405/Makefile  | 4 
 board/esd/hh405/Makefile  | 4 
 board/esd/hub405/Makefile | 4 
 board/esd/ocrtc/Makefile  | 4 
 board/esd/pci405/Makefile | 4 
 board/esd/pf5200/Makefile | 4 
 board/esd/plu405/Makefile | 4 
 board/esd/pmc405/Makefile | 4 
 board/esd/pmc405de/Makefile   | 4 
 board/esd/pmc440/Makefile | 4 
 board/esd/voh405/Makefile | 4 
 board/esd/vom405/Makefile | 4 
 board/esd/wuh405/Makefile | 4 
 board/keymile/km82xx/Makefile | 3 ---
 board/keymile/km83xx/Makefile | 4 
 board/keymile/km_arm/Makefile | 4 
 board/keymile/kmp204x/Makefile| 4 
 board/kup/kup4k/Makefile  | 4 
 board/kup/kup4x/Makefile  | 4 
 board/mpl/mip405/Makefile | 4 
 board/mpl/pati/Makefile   | 4 
 board/mpl/pip405/Makefile | 4 
 board/mpl/vcma9/Makefile  | 4 
 board/nvidia/beaver/Makefile  | 2 --
 board/nvidia/ventana/Makefile | 2 --
 board/prodrive/p3mx/Makefile  | 4 
 board/psyent/pci5441/Makefile | 4 
 board/psyent/pk1c20/Makefile  | 4 
 board/sandburst/karef/Makefile| 4 
 board/sandburst/metrobox/Makefile | 4 
 board/siemens/dxr2/Makefile   | 4 
 board/siemens/pxm2/Makefile   | 4 
 board/siemens/rut/Makefile| 4 
 board/toradex/colibri_t20_iris/Makefile   | 3 ---
 board/tqc/tqm8260/Makefile| 4 
 board/tqc/tqm8272/Makefile| 4 
 board/xilinx/ppc405-generic/Makefile  | 4 
 board/xilinx/ppc440-generic/Makefile  | 4 
 drivers/bios_emulator/Makefile| 2 --
 scripts/Makefile.build| 7 +++
 68 files changed, 7 insertions(+), 247 deletions(-)

diff --git a/arch/powerpc/cpu/mpc512x/Makefile 
b/arch/powerpc/cpu/mpc512x/Makefile
index f770350..a4934ef 100644
--- a/arch/powerpc/cpu/mpc512x/Makefile
+++ b/arch/powerpc/cpu/mpc512x/Makefile
@@ -4,8 +4,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-$(shell mkdir -p $(OBJTREE)/board/freescale/common)
-
 extra-y= start.o
 obj-y  := cpu.o
 obj-y  += traps.o
diff --git a/arch/powerpc/cpu/mpc824x/Makefile 
b/arch/powerpc/cpu/mpc824x/Makefile
index 67b0d17..194fadd 100644
--- a/arch/powerpc/cpu/mpc824x/Makefile
+++ b/arch/powerpc/cpu/mpc824x/Makefile
@@ -5,10 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)drivers/epic $(obj)drivers/i2c)
-endif
-
 extra-y= start.o
 obj-y  = traps.o cpu.o cpu_init.o interrupts.o speed.o \
  drivers/epic/epic1.o drivers/i2c/i2c.o pci.o
diff --git a/board/LaCie/edminiv2/Makefile b/board/LaCie/edminiv2/Makefile
index 7ca06f5..035f686 100644
--- a/board/LaCie/edminiv2/Makefile
+++ b/board/LaCie/edminiv2/Makefile
@@ -9,8 +9,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
-
 obj-y  := edminiv2.o ../common/common.o
diff --git a/board/LaCie/net2big_v2/Makefile b/board/LaCie/net2big_v2/Makefile
index 4fa08c5..f3074af 100644
--- 

[U-Boot] [PATCH 17/22] powerpc: mpc83xx: delete unused rules

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/powerpc/cpu/mpc83xx/Makefile | 6 --
 1 file changed, 6 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Makefile 
b/arch/powerpc/cpu/mpc83xx/Makefile
index b7142f0..a501a3b 100644
--- a/arch/powerpc/cpu/mpc83xx/Makefile
+++ b/arch/powerpc/cpu/mpc83xx/Makefile
@@ -48,11 +48,5 @@ obj-$(CONFIG_FSL_DDR2) += law.o
 
 endif # not minimal
 
-$(obj)ddr-gen1.c:
-   ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen1.c $(obj)ddr-gen1.c
-
 $(obj)ddr-gen2.c:
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen2.c $(obj)ddr-gen2.c
-
-$(obj)ddr-gen3.c:
-   ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen3.c $(obj)ddr-gen3.c
-- 
1.8.3.2

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


[U-Boot] [PATCH 03/22] drivers: descend into sub directories only when it is necessary

2013-11-10 Thread Masahiro Yamada
  - Descend into drivers/fpga/ only when CONFIG_FPGA=y
  - Descend into drivers/bios_emulator only when CONFIG_BIOSEMU=y

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 drivers/Makefile   | 4 ++--
 drivers/bios_emulator/Makefile | 2 +-
 drivers/fpga/Makefile  | 2 --
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 9cec2ba..95a4b80 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -1,8 +1,8 @@
-obj-y += bios_emulator/
+obj-$(CONFIG_BIOSEMU) += bios_emulator/
 obj-y += block/
 obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
 obj-y += crypto/
-obj-y += fpga/
+obj-$(CONFIG_FPGA) += fpga/
 obj-y += hwmon/
 obj-y += misc/
 obj-y += pcmcia/
diff --git a/drivers/bios_emulator/Makefile b/drivers/bios_emulator/Makefile
index dd42e0f..9aa8ea9 100644
--- a/drivers/bios_emulator/Makefile
+++ b/drivers/bios_emulator/Makefile
@@ -2,7 +2,7 @@ X86DIR  = x86emu
 
 $(shell mkdir -p $(obj)$(X86DIR))
 
-obj-$(CONFIG_BIOSEMU)  = atibios.o biosemu.o besys.o bios.o \
+obj-y = atibios.o biosemu.o besys.o bios.o \
$(X86DIR)/decode.o \
$(X86DIR)/ops2.o \
$(X86DIR)/ops.o \
diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile
index 4fcdf40..dfb2e7f 100644
--- a/drivers/fpga/Makefile
+++ b/drivers/fpga/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_FPGA
 obj-y += fpga.o
 obj-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
 obj-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
@@ -19,4 +18,3 @@ obj-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
 obj-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
 obj-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
 endif
-endif
-- 
1.8.3.2

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


[U-Boot] [PATCH 07/22] Makefile: merge $(LIBBOARD) into $(LIBS)

2013-11-10 Thread Masahiro Yamada
We do not need to handle $(LIBBOARD) and $(LIBS) separately.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index e12f180..419278a 100644
--- a/Makefile
+++ b/Makefile
@@ -306,12 +306,11 @@ endif
 
 LIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o
 
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+
 LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
 .PHONY : $(LIBS)
 
-LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
-LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
-
 # Add GCC lib
 ifdef USE_PRIVATE_LIBGCC
 ifeq ($(USE_PRIVATE_LIBGCC), yes)
@@ -335,7 +334,7 @@ LDPPFLAGS += \
  sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
 
 __OBJS := $(subst $(obj),,$(OBJS))
-__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
+__LIBS := $(subst $(obj),,$(LIBS))
 
 #
 #
@@ -549,7 +548,7 @@ GEN_UBOOT = \
 endif
 
 $(obj)u-boot:  depend \
-   $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) 
$(obj)u-boot.lds
+   $(SUBDIR_TOOLS) $(OBJS) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
$(GEN_UBOOT)
 ifeq ($(CONFIG_KALLSYMS),y)
smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \
@@ -566,10 +565,6 @@ $(LIBS):   depend $(SUBDIR_TOOLS)
$(MAKE) $(build) $(dir $(subst $(obj),,$@))
mv $(dir $@)built-in.o $@
 
-$(LIBBOARD):   depend $(LIBS)
-   $(MAKE) $(build) $(dir $(subst $(obj),,$@))
-   mv $(dir $@)built-in.o $@
-
 $(SUBDIRS):depend
$(MAKE) -C $@ all
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 08/22] powerpc: move mpc8xxx entry under arch/powerpc/cpu/

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile  |  9 +
 arch/powerpc/cpu/Makefile |  3 +++
 arch/powerpc/cpu/mpc8xxx/Makefile |  6 ++
 spl/Makefile  | 13 +
 4 files changed, 11 insertions(+), 20 deletions(-)
 create mode 100644 arch/powerpc/cpu/Makefile

diff --git a/Makefile b/Makefile
index 419278a..3a8ea67 100644
--- a/Makefile
+++ b/Makefile
@@ -273,18 +273,10 @@ LIBS-y += drivers/power/libpower.o \
 LIBS-y += drivers/spi/libspi.o
 ifeq ($(CPU),mpc83xx)
 LIBS-y += drivers/qe/libqe.o
-LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
-LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
 ifeq ($(CPU),mpc85xx)
 LIBS-y += drivers/qe/libqe.o
 LIBS-y += drivers/net/fm/libfm.o
-LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
-LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
-endif
-ifeq ($(CPU),mpc86xx)
-LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
-LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
 LIBS-y += drivers/serial/libserial.o
 LIBS-y += drivers/usb/eth/libusb_eth.o
@@ -305,6 +297,7 @@ LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 
 LIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o
+LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/libcpu.o
 
 LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
 
diff --git a/arch/powerpc/cpu/Makefile b/arch/powerpc/cpu/Makefile
new file mode 100644
index 000..d630abe
--- /dev/null
+++ b/arch/powerpc/cpu/Makefile
@@ -0,0 +1,3 @@
+ifneq ($(filter mpc83xx mpc85xx mpc86xx,$(CPU)),)
+obj-y += mpc8xxx/
+endif
diff --git a/arch/powerpc/cpu/mpc8xxx/Makefile 
b/arch/powerpc/cpu/mpc8xxx/Makefile
index 395fed1..1d083bf 100644
--- a/arch/powerpc/cpu/mpc8xxx/Makefile
+++ b/arch/powerpc/cpu/mpc8xxx/Makefile
@@ -31,3 +31,9 @@ obj-$(CONFIG_SYS_SRIO) += srio.o
 obj-$(CONFIG_FSL_LAW) += law.o
 
 endif
+
+ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT) += ddr/
+else
+obj-y += ddr/
+endif
diff --git a/spl/Makefile b/spl/Makefile
index cbd3d27..0ac0c3c 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -57,18 +57,6 @@ endif
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
 
 LIBS-y += $(CPUDIR)/lib$(CPU).o
-ifeq ($(CPU),mpc83xx)
-LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
-endif
-ifeq ($(CPU),mpc85xx)
-LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
-ifdef CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
-LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
-endif
-endif
-ifeq ($(CPU),mpc86xx)
-LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
-endif
 
 ifdef SOC
 LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
@@ -106,6 +94,7 @@ LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 
 LIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o
+LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/libcpu.o
 
 ifneq ($(CONFIG_MX23)$(CONFIG_MX35),)
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
-- 
1.8.3.2

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


[U-Boot] [PATCH 21/22] Makefile: move fs/fat/ entry to drivers/Makefile

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Simon Glass s...@chromium.org
---
 Makefile | 3 +--
 fs/Makefile  | 5 +
 spl/Makefile | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index c04917f..b8713a4 100644
--- a/Makefile
+++ b/Makefile
@@ -243,8 +243,7 @@ endif
 LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
 LIBS-$(CONFIG_OF_EMBED) += dts/
 LIBS-y += arch/$(ARCH)/lib/
-LIBS-y += fs/ \
-   fs/fat/
+LIBS-y += fs/
 LIBS-y += net/
 LIBS-y += disk/
 LIBS-y += drivers/
diff --git a/fs/Makefile b/fs/Makefile
index bdcd746..ee01a7d 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -6,11 +6,15 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
+else
 obj-y  += fs.o
 
 obj-y += cbfs/
 obj-y += cramfs/
 obj-y += ext4/
+obj-y += fat/
 obj-y += fdos/
 obj-y += jffs2/
 obj-y += reiserfs/
@@ -18,3 +22,4 @@ obj-y += sandbox/
 obj-y += ubifs/
 obj-y += yaffs2/
 obj-y += zfs/
+endif
diff --git a/spl/Makefile b/spl/Makefile
index 5bc75b4..29d7818 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -73,7 +73,7 @@ LIBS-$(CONFIG_SPL_MMC_SUPPORT) += drivers/mmc/
 LIBS-$(CONFIG_SPL_SERIAL_SUPPORT) += drivers/serial/
 LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/
 LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/
-LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/
+LIBS-y += fs/
 LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
 LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ \
drivers/power/pmic/
-- 
1.8.3.2

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


[U-Boot] [PATCH 00/22] A collection of trivial Makefile refactoring

2013-11-10 Thread Masahiro Yamada
This series does not add any new features but
refactor makefiles.

Masahiro Yamada (22):
  Makefile: abolish COBJS, SOBJS, etc.
  Makefile: specifiy an explicite object name rather than $(BOARD).o
  drivers: descend into sub directories only when it is necessary
  lib: descend into sub directories only when it is necessary
  drivers: tpm: clean up unused code
  Makefile: make directories by Makefile.build
  Makefile: merge $(LIBBOARD) into $(LIBS)
  powerpc: move mpc8xxx entry under arch/powerpc/cpu/
  drivers/qe: move the entry to drivers/Makefile
  drivers/net/fm: descend only when CONFIG_FMAN_ENET=y
  drivers/net/npe: descend only when CONFIG_IXP4XX_NPE=y
  Makefile: rename all libraries to built-in.o
  Makefile: refactor a little
  config.mk: delete unnecessary lines
  tools: Makefile: delete redundant lines
  Makefile: delete unused lines
  powerpc: mpc83xx: delete unused rules
  powerpc: mpc83xx: Do not create a symbolic link to ddr-gen2.c
  powerpc: mpc824x: Do not create a symbolic link to bedbug_603e.c
  arm: rmobile: Do not create a symbolic link to sh timer
  Makefile: move fs/fat/ entry to drivers/Makefile
  fs: descend into sub directories when it is necessary

 Makefile   | 149 +--
 arch/arm/cpu/armv7/rmobile/Makefile|   8 +-
 arch/microblaze/cpu/u-boot.lds |   2 +-
 arch/powerpc/cpu/Makefile  |   3 +
 arch/powerpc/cpu/mpc512x/Makefile  |   2 -
 arch/powerpc/cpu/mpc824x/.gitignore|   1 -
 arch/powerpc/cpu/mpc824x/Makefile  |  10 +-
 arch/powerpc/cpu/mpc83xx/Makefile  |  12 +-
 arch/powerpc/cpu/mpc8xxx/Makefile  |   6 +
 board/LEOX/elpt860/u-boot.lds  |   8 +-
 board/LaCie/edminiv2/Makefile  |   4 -
 board/LaCie/net2big_v2/Makefile|   4 -
 board/LaCie/netspace_v2/Makefile   |   4 -
 board/LaCie/wireless_space/Makefile|   4 -
 board/Marvell/db64360/Makefile |   4 -
 board/Marvell/db64460/Makefile |   4 -
 board/actux1/u-boot.lds|   8 +-
 board/actux2/u-boot.lds|   8 +-
 board/actux3/u-boot.lds|   8 +-
 board/altera/nios2-generic/Makefile|   4 -
 board/avionic-design/medcom-wide/Makefile  |   2 -
 board/avionic-design/plutux/Makefile   |   2 -
 board/avionic-design/tec/Makefile  |   2 -
 board/compal/paz00/Makefile|   2 -
 board/compulab/trimslice/Makefile  |   2 -
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |   4 +-
 board/dvlhost/u-boot.lds   |   8 +-
 board/emk/top5200/Makefile |   4 -
 board/emk/top860/Makefile  |   3 -
 board/esd/adciop/Makefile  |   4 -
 board/esd/apc405/Makefile  |   4 -
 board/esd/ar405/Makefile   |   4 -
 board/esd/ash405/Makefile  |   4 -
 board/esd/cms700/Makefile  |   4 -
 board/esd/cpci2dp/Makefile |   4 -
 board/esd/cpci405/Makefile |   4 -
 board/esd/cpci5200/Makefile|   4 -
 board/esd/cpci750/Makefile |   4 -
 board/esd/cpciiser4/Makefile   |   4 -
 board/esd/dasa_sim/Makefile|   4 -
 board/esd/dp405/Makefile   |   4 -
 board/esd/du405/Makefile   |   4 -
 board/esd/hh405/Makefile   |   4 -
 board/esd/hub405/Makefile  |   4 -
 board/esd/ocrtc/Makefile   |   4 -
 board/esd/pci405/Makefile  |   4 -
 board/esd/pf5200/Makefile  |   4 -
 board/esd/plu405/Makefile  |   4 -
 board/esd/pmc405/Makefile  |   4 -
 board/esd/pmc405de/Makefile|   4 -
 board/esd/pmc440/Makefile  |   4 -
 board/esd/voh405/Makefile  |   4 -
 board/esd/vom405/Makefile  |   4 -
 board/esd/wuh405/Makefile  |   4 -
 board/esteem192e/u-boot.lds|   4 +-
 board/freescale/m52277evb/u-boot.lds   |   4 +-
 board/freescale/m53017evb/u-boot.lds   |   6 +-
 board/freescale/mx31ads/u-boot.lds |  10 +-
 board/freescale/t1040qds/Makefile  |   2 +-
 board/genietv/u-boot.lds   |  10 +-
 board/hermes/u-boot.lds|   2 +-
 board/keymile/km82xx/Makefile  |   3 -
 board/keymile/km83xx/Makefile  |   4 -
 board/keymile/km_arm/Makefile  |   4 -
 board/keymile/kmp204x/Makefile |   6 +-
 board/kup/kup4k/Makefile   |   4 -
 board/kup/kup4x/Makefile   |   4 -
 board/matrix_vision/mvsmr/u-boot.lds   |   2 +-
 board/mpl/mip405/Makefile  |   4 -
 board/mpl/pati/Makefile|   4 -
 board/mpl/pip405/Makefile  |   4 -
 board/mpl/vcma9/Makefile   |   4 -
 

[U-Boot] [PATCH 04/22] lib: descend into sub directories only when it is necessary

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile  | 8 
 lib/lzma/Makefile | 2 +-
 lib/lzo/Makefile  | 2 +-
 lib/rsa/Makefile  | 4 +---
 lib/zlib/Makefile | 2 +-
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 1f499c5..e12f180 100644
--- a/Makefile
+++ b/Makefile
@@ -232,10 +232,10 @@ OBJS := $(addprefix $(obj),$(OBJS))
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
 
 LIBS-y += lib/libgeneric.o
-LIBS-y += lib/rsa/librsa.o
-LIBS-y += lib/lzma/liblzma.o
-LIBS-y += lib/lzo/liblzo.o
-LIBS-y += lib/zlib/libz.o
+LIBS-$(CONFIG_RSA) += lib/rsa/librsa.o
+LIBS-$(CONFIG_LZMA) += lib/lzma/liblzma.o
+LIBS-$(CONFIG_LZO) += lib/lzo/liblzo.o
+LIBS-$(CONFIG_ZLIB) += lib/zlib/libz.o
 LIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o
 LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
 LIBS-y += $(CPUDIR)/lib$(CPU).o
diff --git a/lib/lzma/Makefile b/lib/lzma/Makefile
index 25c6797..f8eda06 100644
--- a/lib/lzma/Makefile
+++ b/lib/lzma/Makefile
@@ -10,4 +10,4 @@
 
 CFLAGS += -D_LZMA_PROB32
 
-obj-$(CONFIG_LZMA) += LzmaDec.o LzmaTools.o
+obj-y += LzmaDec.o LzmaTools.o
diff --git a/lib/lzo/Makefile b/lib/lzo/Makefile
index dd853ea..2936544 100644
--- a/lib/lzo/Makefile
+++ b/lib/lzo/Makefile
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_LZO) += lzo1x_decompress.o
+obj-y += lzo1x_decompress.o
diff --git a/lib/rsa/Makefile b/lib/rsa/Makefile
index 693c745..164ab39 100644
--- a/lib/rsa/Makefile
+++ b/lib/rsa/Makefile
@@ -7,6 +7,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_FIT_SIGNATURE
-obj-$(CONFIG_RSA) += rsa-verify.o
-endif
+obj-$(CONFIG_FIT_SIGNATURE) += rsa-verify.o
diff --git a/lib/zlib/Makefile b/lib/zlib/Makefile
index 1e9e04d..2fba95f 100644
--- a/lib/zlib/Makefile
+++ b/lib/zlib/Makefile
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_ZLIB) += zlib.o
+obj-y += zlib.o
-- 
1.8.3.2

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


[U-Boot] [PATCH 10/22] drivers/net/fm: descend only when CONFIG_FMAN_ENET=y

2013-11-10 Thread Masahiro Yamada
CONFIG_FMAN_ENET is defined only for CPU mpc85xx.
We do not need to filter by CPU mpc85xx.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile| 4 +---
 drivers/net/fm/Makefile | 2 --
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 0e9609f..5cdfc6d 100644
--- a/Makefile
+++ b/Makefile
@@ -271,9 +271,7 @@ LIBS-y += drivers/power/libpower.o \
drivers/power/pmic/libpmic.o \
drivers/power/battery/libbattery.o
 LIBS-y += drivers/spi/libspi.o
-ifeq ($(CPU),mpc85xx)
-LIBS-y += drivers/net/fm/libfm.o
-endif
+LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/libfm.o
 LIBS-y += drivers/serial/libserial.o
 LIBS-y += drivers/usb/eth/libusb_eth.o
 LIBS-y += drivers/usb/gadget/libusb_gadget.o
diff --git a/drivers/net/fm/Makefile b/drivers/net/fm/Makefile
index bec86c1..eec75fd 100644
--- a/drivers/net/fm/Makefile
+++ b/drivers/net/fm/Makefile
@@ -4,7 +4,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_FMAN_ENET
 obj-y += dtsec.o
 obj-y += eth.o
 obj-y += fm.o
@@ -30,4 +29,3 @@ obj-$(CONFIG_PPC_T4240) += t4240.o
 obj-$(CONFIG_PPC_T4160) += t4240.o
 obj-$(CONFIG_PPC_B4420) += b4860.o
 obj-$(CONFIG_PPC_B4860) += b4860.o
-endif
-- 
1.8.3.2

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


[U-Boot] [PATCH 18/22] powerpc: mpc83xx: Do not create a symbolic link to ddr-gen2.c

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile  | 1 -
 arch/powerpc/cpu/mpc83xx/Makefile | 6 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 5ad2bd7..4f5a1ac 100644
--- a/Makefile
+++ b/Makefile
@@ -861,7 +861,6 @@ clobber:tidy
@rm -f $(obj)SPL
@rm -f $(obj)tools/xway-swap-bytes
@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
-   @rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c
@rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@rm -fr $(obj)include/generated
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name * -type l 
-print | xargs rm -f
diff --git a/arch/powerpc/cpu/mpc83xx/Makefile 
b/arch/powerpc/cpu/mpc83xx/Makefile
index a501a3b..d3f7001 100644
--- a/arch/powerpc/cpu/mpc83xx/Makefile
+++ b/arch/powerpc/cpu/mpc83xx/Makefile
@@ -39,14 +39,10 @@ obj-$(CONFIG_OF_LIBFDT) += fdt.o
 obj-y += cache.o
 
 ifdef CONFIG_FSL_DDR2
-obj-$(CONFIG_MPC8349) += ddr-gen2.o
-SRCS += $(obj)ddr-gen2.c
+obj-$(CONFIG_MPC8349) += ../mpc85xx/ddr-gen2.o
 else
 obj-y += spd_sdram.o
 endif
 obj-$(CONFIG_FSL_DDR2) += law.o
 
 endif # not minimal
-
-$(obj)ddr-gen2.c:
-   ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen2.c $(obj)ddr-gen2.c
-- 
1.8.3.2

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


[U-Boot] [PATCH 19/22] powerpc: mpc824x: Do not create a symbolic link to bedbug_603e.c

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile| 1 -
 arch/powerpc/cpu/mpc824x/.gitignore | 1 -
 arch/powerpc/cpu/mpc824x/Makefile   | 6 +-
 3 files changed, 1 insertion(+), 7 deletions(-)
 delete mode 100644 arch/powerpc/cpu/mpc824x/.gitignore

diff --git a/Makefile b/Makefile
index 4f5a1ac..c04917f 100644
--- a/Makefile
+++ b/Makefile
@@ -860,7 +860,6 @@ clobber:tidy
@rm -f $(obj)MLO MLO.byteswap
@rm -f $(obj)SPL
@rm -f $(obj)tools/xway-swap-bytes
-   @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
@rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@rm -fr $(obj)include/generated
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name * -type l 
-print | xargs rm -f
diff --git a/arch/powerpc/cpu/mpc824x/.gitignore 
b/arch/powerpc/cpu/mpc824x/.gitignore
deleted file mode 100644
index 2d79931..000
--- a/arch/powerpc/cpu/mpc824x/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bedbug_603e.c
diff --git a/arch/powerpc/cpu/mpc824x/Makefile 
b/arch/powerpc/cpu/mpc824x/Makefile
index 194fadd..2c8be92 100644
--- a/arch/powerpc/cpu/mpc824x/Makefile
+++ b/arch/powerpc/cpu/mpc824x/Makefile
@@ -8,8 +8,4 @@
 extra-y= start.o
 obj-y  = traps.o cpu.o cpu_init.o interrupts.o speed.o \
  drivers/epic/epic1.o drivers/i2c/i2c.o pci.o
-obj-y += bedbug_603e.o
-
-SRCS += $(obj)bedbug_603e.c
-$(obj)bedbug_603e.c:
-   ln -sf $(src)../mpc8260/bedbug_603e.c $(obj)bedbug_603e.c
+obj-y += ../mpc8260/bedbug_603e.o
-- 
1.8.3.2

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


[U-Boot] [PATCH 14/22] config.mk: delete unnecessary lines

2013-11-10 Thread Masahiro Yamada
SPL_BIN is already defined in spl/Makefile
and it is used only in spl/Makefile.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 config.mk | 6 --
 1 file changed, 6 deletions(-)

diff --git a/config.mk b/config.mk
index 8a82ab4..7c5c82d 100644
--- a/config.mk
+++ b/config.mk
@@ -13,12 +13,6 @@ SHELL := $(shell if [ -x $$BASH ]; then echo $$BASH; \
 
 export SHELL
 
-ifeq ($(CONFIG_TPL_BUILD),y)
-SPL_BIN := u-boot-tpl
-else
-SPL_BIN := u-boot-spl
-endif
-
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
 else
-- 
1.8.3.2

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


[U-Boot] [PATCH 11/22] drivers/net/npe: descend only when CONFIG_IXP4XX_NPE=y

2013-11-10 Thread Masahiro Yamada
CONFIG_IXP4XX_NPE is defined only for CPU ixp.
It is not necessary to filter by CPU ixp.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile | 4 +---
 drivers/net/npe/Makefile | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 5cdfc6d..4724f41 100644
--- a/Makefile
+++ b/Makefile
@@ -242,9 +242,7 @@ LIBS-y += $(CPUDIR)/lib$(CPU).o
 ifdef SOC
 LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
 endif
-ifeq ($(CPU),ixp)
-LIBS-y += drivers/net/npe/libnpe.o
-endif
+LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/libnpe.o
 LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
 LIBS-y += fs/libfs.o \
diff --git a/drivers/net/npe/Makefile b/drivers/net/npe/Makefile
index 7fa5ea6..e36c0bb 100644
--- a/drivers/net/npe/Makefile
+++ b/drivers/net/npe/Makefile
@@ -10,7 +10,7 @@ CFLAGS  += $(LOCAL_CFLAGS)
 CPPFLAGS  += $(LOCAL_CFLAGS) # needed for depend
 HOSTCFLAGS  += $(LOCAL_CFLAGS)
 
-obj-$(CONFIG_IXP4XX_NPE) := npe.o \
+obj-y := npe.o \
miiphy.o \
IxOsalBufferMgt.o \
IxOsalIoMem.o \
-- 
1.8.3.2

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


[U-Boot] [PATCH 05/22] drivers: tpm: clean up unused code

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 drivers/tpm/Makefile  |   2 -
 drivers/tpm/tis_i2c.c | 185 --
 2 files changed, 187 deletions(-)
 delete mode 100644 drivers/tpm/tis_i2c.c

diff --git a/drivers/tpm/Makefile b/drivers/tpm/Makefile
index 4b8cbec..2f2353f 100644
--- a/drivers/tpm/Makefile
+++ b/drivers/tpm/Makefile
@@ -3,8 +3,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-$(shell mkdir -p $(obj)slb9635_i2c)
-
 # TODO: Merge tpm_tis_lpc.c with tpm.c
 obj-$(CONFIG_TPM_ATMEL_TWI) += tpm_atmel_twi.o
 obj-$(CONFIG_TPM_TIS_I2C) += tpm.o
diff --git a/drivers/tpm/tis_i2c.c b/drivers/tpm/tis_i2c.c
deleted file mode 100644
index 22554e1..000
--- a/drivers/tpm/tis_i2c.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include config.h
-#include common.h
-#include fdtdec.h
-#include i2c.h
-#include slb9635_i2c/tpm.h
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/* TPM configuration */
-struct tpm {
-   int i2c_bus;
-   int slave_addr;
-   char inited;
-   int old_bus;
-} tpm;
-
-
-static int tpm_select(void)
-{
-   int ret;
-
-   tpm.old_bus = i2c_get_bus_num();
-   if (tpm.old_bus != tpm.i2c_bus) {
-   ret = i2c_set_bus_num(tpm.i2c_bus);
-   if (ret) {
-   debug(%s: Fail to set i2c bus %d\n, __func__,
- tpm.i2c_bus);
-   return -1;
-   }
-   }
-   return 0;
-}
-
-static int tpm_deselect(void)
-{
-   int ret;
-
-   if (tpm.old_bus != i2c_get_bus_num()) {
-   ret = i2c_set_bus_num(tpm.old_bus);
-   if (ret) {
-   debug(%s: Fail to restore i2c bus %d\n,
- __func__, tpm.old_bus);
-   return -1;
-   }
-   }
-   tpm.old_bus = -1;
-   return 0;
-}
-
-/**
- * Decode TPM configuration.
- *
- * @param dev  Returns a configuration of TPM device
- * @return 0 if ok, -1 on error
- */
-static int tpm_decode_config(struct tpm *dev)
-{
-#ifdef CONFIG_OF_CONTROL
-   const void *blob = gd-fdt_blob;
-   int node, parent;
-   int i2c_bus;
-
-   node = fdtdec_next_compatible(blob, 0, COMPAT_INFINEON_SLB9635_TPM);
-   if (node  0) {
-   node = fdtdec_next_compatible(blob, 0,
- COMPAT_INFINEON_SLB9645_TPM);
-   }
-   if (node  0) {
-   debug(%s: Node not found\n, __func__);
-   return -1;
-   }
-   parent = fdt_parent_offset(blob, node);
-   if (parent  0) {
-   debug(%s: Cannot find node parent\n, __func__);
-   return -1;
-   }
-   i2c_bus = i2c_get_bus_num_fdt(parent);
-   if (i2c_bus  0)
-   return -1;
-   dev-i2c_bus = i2c_bus;
-   dev-slave_addr = fdtdec_get_addr(blob, node, reg);
-#else
-   dev-i2c_bus = CONFIG_INFINEON_TPM_I2C_BUS;
-   dev-slave_addr = CONFIG_INFINEON_TPM_I2C_ADDR;
-#endif
-   return 0;
-}
-
-int tis_init(void)
-{
-   if (tpm.inited)
-   return 0;
-
-   if (tpm_decode_config(tpm))
-   return -1;
-
-   if (tpm_select())
-   return -1;
-
-   /*
-* Probe TPM twice; the first probing might fail because TPM is asleep,
-* and the probing can wake up TPM.
-*/
-   if (i2c_probe(tpm.slave_addr)  i2c_probe(tpm.slave_addr)) {
-   debug(%s: fail to probe i2c addr 0x%x\n, __func__,
- tpm.slave_addr);
-   return -1;
-   }
-
-   tpm_deselect();
-
-   tpm.inited = 1;
-
-   return 0;
-}
-
-int tis_open(void)
-{
-   int rc;
-
-   if (!tpm.inited)
-   return -1;
-
-   if (tpm_select())
-   return -1;
-
-   rc = tpm_open(tpm.slave_addr);
-
-   tpm_deselect();
-
-   return rc;
-}
-
-int tis_close(void)
-{
-   if (!tpm.inited)
-   return -1;
-
-   if (tpm_select())
-   return -1;
-
-   tpm_close();
-
-   tpm_deselect();
-
-   return 0;
-}
-
-int tis_sendrecv(const uint8_t *sendbuf, size_t sbuf_size,
-   uint8_t *recvbuf, size_t *rbuf_len)
-{
-   int len;
-   uint8_t buf[4096];
-
-   if (!tpm.inited)
-   return -1;
-
-   if (sizeof(buf)  sbuf_size)
-   return -1;
-
-   memcpy(buf, sendbuf, sbuf_size);
-
-   if (tpm_select())
-   return -1;
-
-   len = tpm_transmit(buf, sbuf_size);
-
-   tpm_deselect();
-
-   if (len  10) {
-   *rbuf_len = 0;
-   return -1;
-   }
-
-   memcpy(recvbuf, buf, len);
-   *rbuf_len = len;
-
-   return 0;
-}
-- 
1.8.3.2

___
U-Boot mailing 

[U-Boot] [PATCH 15/22] tools: Makefile: delete redundant lines

2013-11-10 Thread Masahiro Yamada
HOSTOS is defined and exported at the top Makefile.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 tools/gdb/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/gdb/Makefile b/tools/gdb/Makefile
index dee91fc..dd98fb6 100644
--- a/tools/gdb/Makefile
+++ b/tools/gdb/Makefile
@@ -23,8 +23,6 @@ BINS  := $(addprefix $(obj),$(BINS))
 #
 HOSTCPPFLAGS = -I$(BFD_ROOT_DIR)/include
 
-HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')
-
 ifeq ($(HOSTOS),cygwin)
 
 all:
-- 
1.8.3.2

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


[U-Boot] [PATCH 09/22] drivers/qe: move the entry to drivers/Makefile

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile| 4 
 drivers/Makefile| 1 +
 drivers/qe/Makefile | 4 ++--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 3a8ea67..0e9609f 100644
--- a/Makefile
+++ b/Makefile
@@ -271,11 +271,7 @@ LIBS-y += drivers/power/libpower.o \
drivers/power/pmic/libpmic.o \
drivers/power/battery/libbattery.o
 LIBS-y += drivers/spi/libspi.o
-ifeq ($(CPU),mpc83xx)
-LIBS-y += drivers/qe/libqe.o
-endif
 ifeq ($(CPU),mpc85xx)
-LIBS-y += drivers/qe/libqe.o
 LIBS-y += drivers/net/fm/libfm.o
 endif
 LIBS-y += drivers/serial/libserial.o
diff --git a/drivers/Makefile b/drivers/Makefile
index 95a4b80..5d03f37 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -13,3 +13,4 @@ obj-y += tpm/
 obj-y += twserial/
 obj-y += video/
 obj-y += watchdog/
+obj-$(CONFIG_QE) += qe/
diff --git a/drivers/qe/Makefile b/drivers/qe/Makefile
index b8c15f8..7f1bd06 100644
--- a/drivers/qe/Makefile
+++ b/drivers/qe/Makefile
@@ -4,5 +4,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(and $(CONFIG_QE),$(CONFIG_OF_LIBFDT)) += fdt.o
-obj-$(CONFIG_QE) += qe.o uccf.o uec.o uec_phy.o
+obj-y := qe.o uccf.o uec.o uec_phy.o
+obj-$(CONFIG_OF_LIBFDT) += fdt.o
-- 
1.8.3.2

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


[U-Boot] [PATCH 01/22] Makefile: abolish COBJS, SOBJS, etc.

2013-11-10 Thread Masahiro Yamada
The support for COBJS, COBJS-y, SOBJS, SOBJS-y, GLCOBJS, GLSOBJS
from scripts/Makefile.build.
Going forward we need to use Kbuild style consistently.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 scripts/Makefile.build | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 2ef7341..805c3c3 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -10,10 +10,6 @@ SRCS :=
 
 include Makefile
 
-# Backward compatible: obj-y is preferable
-COBJS := $(sort $(COBJS) $(COBJS-y))
-SOBJS := $(sort $(SOBJS) $(SOBJS-y))
-
 # Going forward use the following
 obj-y := $(sort $(obj-y))
 extra-y := $(sort $(extra-y))
@@ -24,11 +20,11 @@ obj-y   := $(patsubst %/, %/built-in.o, 
$(obj-y))
 subdir-obj-y   := $(filter %/built-in.o, $(obj-y))
 subdir-obj-y   := $(addprefix $(obj),$(subdir-obj-y))
 
-SRCS   += $(COBJS:.o=.c) $(SOBJS:.o=.S) \
- $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) $(lib-y:.o=.S) 
$(extra-y:.o=.c) $(extra-y:.o=.S))
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS) $(obj-y))
+SRCS   += $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) \
+   $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S))
+OBJS   := $(addprefix $(obj),$(obj-y))
 
-LGOBJS := $(addprefix $(obj),$(sort $(GLSOBJS) $(GLCOBJS)) $(lib-y))
+LGOBJS := $(addprefix $(obj),$(sort $(lib-y)))
 
 all: $(LIB) $(addprefix $(obj),$(extra-y))
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 02/22] Makefile: specifiy an explicite object name rather than $(BOARD).o

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 board/freescale/t1040qds/Makefile | 2 +-
 board/keymile/kmp204x/Makefile| 2 +-
 board/ti/beagle/Makefile  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/freescale/t1040qds/Makefile 
b/board/freescale/t1040qds/Makefile
index a2dba6f..93af9eb 100644
--- a/board/freescale/t1040qds/Makefile
+++ b/board/freescale/t1040qds/Makefile
@@ -4,7 +4,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-y  += $(BOARD).o
+obj-y  += t1040qds.o
 obj-y  += ddr.o
 obj-$(CONFIG_PCI) += pci.o
 obj-y  += law.o
diff --git a/board/keymile/kmp204x/Makefile b/board/keymile/kmp204x/Makefile
index 64eb37c..c318e08 100644
--- a/board/keymile/kmp204x/Makefile
+++ b/board/keymile/kmp204x/Makefile
@@ -12,5 +12,5 @@ ifneq ($(OBJTREE),$(SRCTREE))
 $(shell mkdir -p $(obj)../common)
 endif
 
-obj-y  := $(BOARD).o ddr.o eth.o tlb.o pci.o law.o \
+obj-y  := kmp204x.o ddr.o eth.o tlb.o pci.o law.o \
../common/common.o ../common/ivm.o
diff --git a/board/ti/beagle/Makefile b/board/ti/beagle/Makefile
index 9f55e8f..7a858be 100644
--- a/board/ti/beagle/Makefile
+++ b/board/ti/beagle/Makefile
@@ -5,5 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-y  := $(BOARD).o
+obj-y  := beagle.o
 obj-$(CONFIG_STATUS_LED) += led.o
-- 
1.8.3.2

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


[U-Boot] [PATCH 20/22] arm: rmobile: Do not create a symbolic link to sh timer

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/cpu/armv7/rmobile/Makefile | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arm/cpu/armv7/rmobile/Makefile 
b/arch/arm/cpu/armv7/rmobile/Makefile
index 8f4cf3a..5e296c4 100644
--- a/arch/arm/cpu/armv7/rmobile/Makefile
+++ b/arch/arm/cpu/armv7/rmobile/Makefile
@@ -15,10 +15,4 @@ obj-$(CONFIG_R8A7740) += cpu_info-r8a7740.o
 obj-$(CONFIG_R8A7740) += pfc-r8a7740.o
 obj-$(CONFIG_SH73A0) += cpu_info-sh73a0.o
 obj-$(CONFIG_SH73A0) += pfc-sh73a0.o
-obj-$(CONFIG_TMU_TIMER) += sh_timer.o
-
-SRCS += $(obj)sh_timer.c
-# from arch/sh/lib/ directory
-$(obj)sh_timer.c:
-   @rm -f $(obj)sh_timer.c
-   ln -s $(SRCTREE)/arch/sh/lib/time.c $(obj)sh_timer.c
+obj-$(CONFIG_TMU_TIMER) += ../../../../sh/lib/time.o
-- 
1.8.3.2

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


[U-Boot] [PATCH 16/22] Makefile: delete unused lines

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile | 6 --
 1 file changed, 6 deletions(-)

diff --git a/Makefile b/Makefile
index e28878b..5ad2bd7 100644
--- a/Makefile
+++ b/Makefile
@@ -784,12 +784,6 @@ sinclude $(obj).boards.depend
 $(obj).boards.depend:  boards.cfg
@awk '(NF  $$1 !~ /^#/) { print $$7 :  $$7 _config; $$(MAKE) }' 
$  $@
 
-#
-# Functions to generate common board directory names
-#
-lcname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/')
-ucname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
-
 #
 #
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 22/22] fs: descend into sub directories when it is necessary

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 fs/Makefile  | 20 ++--
 fs/cbfs/Makefile |  2 +-
 fs/cramfs/Makefile   |  4 ++--
 fs/ext4/Makefile |  2 +-
 fs/fdos/Makefile |  2 +-
 fs/jffs2/Makefile|  2 --
 fs/reiserfs/Makefile |  2 +-
 fs/sandbox/Makefile  |  2 +-
 fs/ubifs/Makefile|  8 
 fs/yaffs2/Makefile   |  2 +-
 fs/zfs/Makefile  |  2 +-
 11 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/fs/Makefile b/fs/Makefile
index ee01a7d..34dc035 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -11,15 +11,15 @@ obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
 else
 obj-y  += fs.o
 
-obj-y += cbfs/
-obj-y += cramfs/
-obj-y += ext4/
+obj-$(CONFIG_CMD_CBFS) += cbfs/
+obj-$(CONFIG_CMD_CRAMFS) += cramfs/
+obj-$(CONFIG_FS_EXT4) += ext4/
 obj-y += fat/
-obj-y += fdos/
-obj-y += jffs2/
-obj-y += reiserfs/
-obj-y += sandbox/
-obj-y += ubifs/
-obj-y += yaffs2/
-obj-y += zfs/
+obj-$(CONFIG_CMD_FDOS) += fdos/
+obj-$(CONFIG_CMD_JFFS2) += jffs2/
+obj-$(CONFIG_CMD_REISER) += reiserfs/
+obj-$(CONFIG_SANDBOX) += sandbox/
+obj-$(CONFIG_CMD_UBIFS) += ubifs/
+obj-$(CONFIG_YAFFS2) += yaffs2/
+obj-$(CONFIG_CMD_ZFS) += zfs/
 endif
diff --git a/fs/cbfs/Makefile b/fs/cbfs/Makefile
index 6f33d28..a106e05 100644
--- a/fs/cbfs/Makefile
+++ b/fs/cbfs/Makefile
@@ -3,4 +3,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_CMD_CBFS) := cbfs.o
+obj-y  := cbfs.o
diff --git a/fs/cramfs/Makefile b/fs/cramfs/Makefile
index e2b2c73..12d73a3 100644
--- a/fs/cramfs/Makefile
+++ b/fs/cramfs/Makefile
@@ -5,5 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_CMD_CRAMFS) := cramfs.o
-obj-$(CONFIG_CMD_CRAMFS) += uncompress.o
+obj-y := cramfs.o
+obj-y += uncompress.o
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
index 0f5d399..8d15bda 100644
--- a/fs/ext4/Makefile
+++ b/fs/ext4/Makefile
@@ -9,5 +9,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_FS_EXT4) := ext4fs.o ext4_common.o dev.o
+obj-y := ext4fs.o ext4_common.o dev.o
 obj-$(CONFIG_EXT4_WRITE) += ext4_write.o ext4_journal.o crc16.o
diff --git a/fs/fdos/Makefile b/fs/fdos/Makefile
index 95480af..2f8b5ad 100644
--- a/fs/fdos/Makefile
+++ b/fs/fdos/Makefile
@@ -10,4 +10,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_CMD_FDOS) := fat.o vfat.o dev.o fdos.o fs.o subdir.o
+obj-y := fat.o vfat.o dev.o fdos.o fs.o subdir.o
diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile
index 02e481f..4cb0600 100644
--- a/fs/jffs2/Makefile
+++ b/fs/jffs2/Makefile
@@ -5,11 +5,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef CONFIG_CMD_JFFS2
 obj-$(CONFIG_JFFS2_LZO) += compr_lzo.o
 obj-y += compr_rtime.o
 obj-y += compr_rubin.o
 obj-y += compr_zlib.o
 obj-y += jffs2_1pass.o
 obj-y += mini_inflate.o
-endif
diff --git a/fs/reiserfs/Makefile b/fs/reiserfs/Makefile
index 55f70b1..5a692f0 100644
--- a/fs/reiserfs/Makefile
+++ b/fs/reiserfs/Makefile
@@ -9,4 +9,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_CMD_REISER) := reiserfs.o dev.o mode_string.o
+obj-y := reiserfs.o dev.o mode_string.o
diff --git a/fs/sandbox/Makefile b/fs/sandbox/Makefile
index faa7c16..ca238f6 100644
--- a/fs/sandbox/Makefile
+++ b/fs/sandbox/Makefile
@@ -10,4 +10,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_SANDBOX) := sandboxfs.o
+obj-y := sandboxfs.o
diff --git a/fs/ubifs/Makefile b/fs/ubifs/Makefile
index 47d5a8f..389b0e3 100644
--- a/fs/ubifs/Makefile
+++ b/fs/ubifs/Makefile
@@ -9,10 +9,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_CMD_UBIFS) := ubifs.o io.o super.o sb.o master.o lpt.o
-obj-$(CONFIG_CMD_UBIFS) += lpt_commit.o scan.o lprops.o
-obj-$(CONFIG_CMD_UBIFS) += tnc.o tnc_misc.o debug.o crc16.o budget.o
-obj-$(CONFIG_CMD_UBIFS) += log.o orphan.o recovery.o replay.o
+obj-y := ubifs.o io.o super.o sb.o master.o lpt.o
+obj-y += lpt_commit.o scan.o lprops.o
+obj-y += tnc.o tnc_misc.o debug.o crc16.o budget.o
+obj-y += log.o orphan.o recovery.o replay.o
 
 # SEE README.arm-unaligned-accesses
 $(obj)super.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
diff --git a/fs/yaffs2/Makefile b/fs/yaffs2/Makefile
index 077af78..d811287 100644
--- a/fs/yaffs2/Makefile
+++ b/fs/yaffs2/Makefile
@@ -16,7 +16,7 @@
 #
 # $Id: Makefile,v 1.15 2007/07/18 19:40:38 charles Exp $
 
-obj-$(CONFIG_YAFFS2) := \
+obj-y := \
yaffs_allocator.o yaffs_attribs.o yaffs_bitmap.o yaffs_uboot_glue.o\
yaffs_checkptrw.o yaffs_ecc.o yaffs_error.o \
yaffsfs.o yaffs_guts.o yaffs_nameval.o yaffs_nand.o\
diff --git a/fs/zfs/Makefile b/fs/zfs/Makefile
index 7090416..fa58b7f 100644
--- a/fs/zfs/Makefile
+++ b/fs/zfs/Makefile
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_CMD_ZFS) := dev.o zfs.o zfs_fletcher.o zfs_sha256.o zfs_lzjb.o
+obj-y := dev.o zfs.o zfs_fletcher.o zfs_sha256.o zfs_lzjb.o
-- 
1.8.3.2

___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH 12/22] Makefile: rename all libraries to built-in.o

2013-11-10 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile   | 112 ++---
 arch/microblaze/cpu/u-boot.lds |   2 +-
 board/LEOX/elpt860/u-boot.lds  |   8 +--
 board/actux1/u-boot.lds|   8 +--
 board/actux2/u-boot.lds|   8 +--
 board/actux3/u-boot.lds|   8 +--
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |   4 +-
 board/dvlhost/u-boot.lds   |   8 +--
 board/esteem192e/u-boot.lds|   4 +-
 board/freescale/m52277evb/u-boot.lds   |   4 +-
 board/freescale/m53017evb/u-boot.lds   |   6 +-
 board/freescale/mx31ads/u-boot.lds |  10 +--
 board/genietv/u-boot.lds   |  10 +--
 board/hermes/u-boot.lds|   2 +-
 board/matrix_vision/mvsmr/u-boot.lds   |   2 +-
 board/mvblue/u-boot.lds|  12 ++--
 board/rbc823/u-boot.lds|   8 +--
 board/spd8xx/u-boot.lds|   4 +-
 board/svm_sc8xx/u-boot.lds |  10 +--
 board/ti/am335x/u-boot.lds |   2 +-
 board/tqc/tqm8xx/u-boot.lds|  14 ++--
 board/vpac270/u-boot-spl.lds   |   4 +-
 include/configs/bct-brettl2.h  |   4 +-
 include/configs/bf533-stamp.h  |   4 +-
 include/configs/bf537-pnav.h   |   4 +-
 include/configs/bf537-stamp.h  |   4 +-
 include/configs/bf538f-ezkit.h |   4 +-
 include/configs/cm-bf537e.h|   4 +-
 include/configs/cm-bf537u.h|   4 +-
 include/configs/dnp5370.h  |   4 +-
 include/configs/ibf-dsp561.h   |   4 +-
 include/configs/tcm-bf537.h|   4 +-
 spl/Makefile   |  73 +--
 33 files changed, 182 insertions(+), 181 deletions(-)

diff --git a/Makefile b/Makefile
index 4724f41..1389ee7 100644
--- a/Makefile
+++ b/Makefile
@@ -231,68 +231,69 @@ OBJS := $(addprefix $(obj),$(OBJS))
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
 
-LIBS-y += lib/libgeneric.o
-LIBS-$(CONFIG_RSA) += lib/rsa/librsa.o
-LIBS-$(CONFIG_LZMA) += lib/lzma/liblzma.o
-LIBS-$(CONFIG_LZO) += lib/lzo/liblzo.o
-LIBS-$(CONFIG_ZLIB) += lib/zlib/libz.o
-LIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o
-LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
-LIBS-y += $(CPUDIR)/lib$(CPU).o
+LIBS-y += lib/
+LIBS-$(CONFIG_RSA) += lib/rsa/
+LIBS-$(CONFIG_LZMA) += lib/lzma/
+LIBS-$(CONFIG_LZO) += lib/lzo/
+LIBS-$(CONFIG_ZLIB) += lib/zlib/
+LIBS-$(CONFIG_TIZEN) += lib/tizen/
+LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
+LIBS-y += $(CPUDIR)/
 ifdef SOC
-LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
-endif
-LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/libnpe.o
-LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o
-LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
-LIBS-y += fs/libfs.o \
-   fs/fat/libfat.o
-LIBS-y += net/libnet.o
-LIBS-y += disk/libdisk.o
-LIBS-y += drivers/libdrivers.o
-LIBS-y += drivers/dma/libdma.o
-LIBS-y += drivers/gpio/libgpio.o
-LIBS-y += drivers/i2c/libi2c.o
-LIBS-y += drivers/input/libinput.o
-LIBS-y += drivers/mmc/libmmc.o
-LIBS-y += drivers/mtd/libmtd.o
-LIBS-y += drivers/mtd/nand/libnand.o
-LIBS-y += drivers/mtd/onenand/libonenand.o
-LIBS-y += drivers/mtd/ubi/libubi.o
-LIBS-y += drivers/mtd/spi/libspi_flash.o
-LIBS-y += drivers/net/libnet.o
-LIBS-y += drivers/net/phy/libphy.o
-LIBS-y += drivers/pci/libpci.o
-LIBS-y += drivers/power/libpower.o \
-   drivers/power/fuel_gauge/libfuel_gauge.o \
-   drivers/power/mfd/libmfd.o \
-   drivers/power/pmic/libpmic.o \
-   drivers/power/battery/libbattery.o
-LIBS-y += drivers/spi/libspi.o
-LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/libfm.o
-LIBS-y += drivers/serial/libserial.o
-LIBS-y += drivers/usb/eth/libusb_eth.o
-LIBS-y += drivers/usb/gadget/libusb_gadget.o
-LIBS-y += drivers/usb/host/libusb_host.o
-LIBS-y += drivers/usb/musb/libusb_musb.o
-LIBS-y += drivers/usb/musb-new/libusb_musb-new.o
-LIBS-y += drivers/usb/phy/libusb_phy.o
-LIBS-y += drivers/usb/ulpi/libusb_ulpi.o
-LIBS-y += common/libcommon.o
-LIBS-y += lib/libfdt/libfdt.o
-LIBS-y += api/libapi.o
-LIBS-y += post/libpost.o
-LIBS-y += test/libtest.o
+LIBS-y += $(CPUDIR)/$(SOC)/
+endif
+LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
+LIBS-$(CONFIG_OF_EMBED) += dts/
+LIBS-y += arch/$(ARCH)/lib/
+LIBS-y += fs/ \
+   fs/fat/
+LIBS-y += net/
+LIBS-y += disk/
+LIBS-y += drivers/
+LIBS-y += drivers/dma/
+LIBS-y += drivers/gpio/
+LIBS-y += drivers/i2c/
+LIBS-y += drivers/input/
+LIBS-y += drivers/mmc/
+LIBS-y += drivers/mtd/
+LIBS-y += drivers/mtd/nand/
+LIBS-y += drivers/mtd/onenand/
+LIBS-y += drivers/mtd/ubi/
+LIBS-y += drivers/mtd/spi/
+LIBS-y += drivers/net/
+LIBS-y += drivers/net/phy/
+LIBS-y += drivers/pci/
+LIBS-y += drivers/power/ \
+   drivers/power/fuel_gauge/ \
+   drivers/power/mfd/ \
+   

Re: [U-Boot] [PATCH] cosmetic: README.scrapyard: Add eNET board

2013-11-10 Thread Simon Glass
On Sun, Nov 10, 2013 at 8:15 PM, Masahiro Yamada
yamad...@jp.panasonic.com wrote:
 Commit 7e8c53d7 removed eNET board but missed to
 add eNET to README.scrapyard.
 This commit adds it for the record.

 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Simon Glass s...@chromium.org
 Cc: Graeme Russ graeme.r...@gmail.com

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

 ---
  doc/README.scrapyard | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/doc/README.scrapyard b/doc/README.scrapyard
 index 7cfb3a3..00bf61f 100644
 --- a/doc/README.scrapyard
 +++ b/doc/README.scrapyard
 @@ -100,3 +100,4 @@ CPCI440  powerpc 440GP  b568fd2 
 2007-12-27  Matthias Fuc
  PCIPPC2  powerpc MPC740/MPC750  7c9e89b 2013-02-07  Wolfgang 
 Denk w...@denx.de
  PCIPPC6  powerpc MPC740/MPC750  -   -   Wolfgang 
 Denk w...@denx.de
  omap2420h4   arm omap24xx   -   2013-06-04  Richard 
 Woodruff r-woodru...@ti.com
 +eNET x86 x867e8c53d 2013-02-14  Graeme 
 Russ graeme.r...@gmail.com
 --
 1.8.3.2

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


Re: [U-Boot] patman drops Cc tag

2013-11-10 Thread Simon Glass
Hi Masahiro,

On Sun, Nov 10, 2013 at 8:11 PM, Masahiro Yamada
yamad...@jp.panasonic.com wrote:
 Hello.

 It seems patman deletes Cc: tag
 when it generating a patch file.
 Is this a bug or a spec?

It uses this to cc patches to people.

 I want Cc: tag not to be touched by patman.

Maybe we could add a new Patch-Cc: tag for this purpose?


 Best Regards
 Masahiro Yamada


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


Re: [U-Boot] [PATCH 21/22] Makefile: move fs/fat/ entry to drivers/Makefile

2013-11-10 Thread Simon Glass
On Sun, Nov 10, 2013 at 10:36 PM, Masahiro Yamada
yamad...@jp.panasonic.com wrote:
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Simon Glass s...@chromium.org

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

 ---
  Makefile | 3 +--
  fs/Makefile  | 5 +
  spl/Makefile | 2 +-
  3 files changed, 7 insertions(+), 3 deletions(-)

 diff --git a/Makefile b/Makefile
 index c04917f..b8713a4 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -243,8 +243,7 @@ endif
  LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
  LIBS-$(CONFIG_OF_EMBED) += dts/
  LIBS-y += arch/$(ARCH)/lib/
 -LIBS-y += fs/ \
 -   fs/fat/
 +LIBS-y += fs/
  LIBS-y += net/
  LIBS-y += disk/
  LIBS-y += drivers/
 diff --git a/fs/Makefile b/fs/Makefile
 index bdcd746..ee01a7d 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
 @@ -6,11 +6,15 @@
  # SPDX-License-Identifier: GPL-2.0+
  #

 +ifdef CONFIG_SPL_BUILD
 +obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
 +else
  obj-y  += fs.o

  obj-y += cbfs/
  obj-y += cramfs/
  obj-y += ext4/
 +obj-y += fat/
  obj-y += fdos/
  obj-y += jffs2/
  obj-y += reiserfs/
 @@ -18,3 +22,4 @@ obj-y += sandbox/
  obj-y += ubifs/
  obj-y += yaffs2/
  obj-y += zfs/
 +endif
 diff --git a/spl/Makefile b/spl/Makefile
 index 5bc75b4..29d7818 100644
 --- a/spl/Makefile
 +++ b/spl/Makefile
 @@ -73,7 +73,7 @@ LIBS-$(CONFIG_SPL_MMC_SUPPORT) += drivers/mmc/
  LIBS-$(CONFIG_SPL_SERIAL_SUPPORT) += drivers/serial/
  LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/
  LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/
 -LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/
 +LIBS-y += fs/
  LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
  LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ \
 drivers/power/pmic/
 --
 1.8.3.2

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


Re: [U-Boot] [PATCH] am33xx: Make SoC bootcount driver have its own symbol

2013-11-10 Thread Heiko Schocher

Hello Tom,

Am 08.11.2013 19:54, schrieb Tom Rini:

Some am33xx boards may not use the RTC block for bootcount (as it may
not be wired up for the board) and use some other facility.  So add
another symbol for the bootcount driver for the IP block.

Cc: Heiko Schocherh...@denx.de
Signed-off-by: Tom Rinitr...@ti.com
---
  drivers/bootcount/Makefile|2 +-
  drivers/bootcount/bootcount_davinci.c |4 
  include/configs/am335x_evm.h  |4 
  include/configs/ti_am335x_common.h|4 ++--
  4 files changed, 11 insertions(+), 3 deletions(-)


Thanks!

Acked-by: Heiko Schocher h...@denx.de

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] patman drops Cc tag

2013-11-10 Thread Masahiro Yamada
Hello Simon

  I want Cc: tag not to be touched by patman.
 
 Maybe we could add a new Patch-Cc: tag for this purpose?

Good.

Cc: patman does nothing. (git send-email can cc patches)
Patch-cc: patman cc patches and deletes this tag.


Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH v2] usb: dfu: make nand upload working

2013-11-10 Thread Heiko Schocher

Hello Lukasz,

Am 08.11.2013 16:41, schrieb Lukasz Majewski:

Hi Bo,


Nowhere pass a value to len, which always 0, make no transfer which
cause uploading failed.

This patch make nand upload working. However it needs enough malloc
buffer to store read data, that means the buffer at least equal to
the upload partition size, or else it doesn't work.

Signed-off-by: Bo Shenvoice.s...@atmel.com


I would kindly ask some users of NAND part of the DFU (Tom, Heiko) to
test if this change doesn't break anything.


I sent a tested-by for this patch, see:

http://lists.denx.de/pipermail/u-boot/2013-November/166552.html

without this patch nand upload didn;t worked on the rut board, with
this patch it worked :-)

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot