Re: [U-Boot] [PATCH v4 1/2] tools, config.mk: add binutils-version

2012-08-01 Thread Mike Frysinger
On Wednesday 01 August 2012 18:46:18 Allen Martin wrote:
> But maybe I'll rewrite it in prolog just to mess with you guys

i'd ack it if it were written in bf
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/7] dfu: MMC specific routines for DFU operation

2012-08-01 Thread Mike Frysinger
On Tuesday 31 July 2012 02:37:00 Lukasz Majewski wrote:
> --- /dev/null
> +++ b/drivers/dfu/dfu_mmc.c
>
> +static int mmc_block_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
> + void *buf, long *len)
> +{
> + ALLOC_CACHE_ALIGN_BUFFER(char, cmd_buf, DFU_CMD_BUF_SIZE);

ugh, what ?  you're passing this string to run_command so there is no point in 
aligning it (not to mention the topic of u-boot code internally calling 
run_command() is seriously wrong.

> + memset(cmd_buf, '\0', sizeof(cmd_buf));
> +
> + sprintf(cmd_buf, "mmc %s 0x%x %x %x",

that memset is pointless.  delete it.

> +static int mmc_file_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
> + void *buf, long *len)
> +{

came comments for this func as above

> +int dfu_fill_entity_mmc(struct dfu_entity *dfu, char* s)

"char *s", not "char* s".  please search all your patches for this mistake as 
it seems to have come up a lot.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] doc/git-mailrc: Update 'ti' alias

2012-08-01 Thread Tom Rini
Remove Sandeep, thanks for all the hard work!

Signed-off-by: Tom Rini 
---
 doc/git-mailrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/git-mailrc b/doc/git-mailrc
index c8a6390..5eac8a5 100644
--- a/doc/git-mailrc
+++ b/doc/git-mailrc
@@ -50,7 +50,7 @@ alias s5pc   samsung
 alias samsunguboot, prom
 alias tegra  uboot, Simon Glass , Tom Warren 
, Stephen Warren 
 alias tegra2 tegra
-alias ti uboot, Sandeep Paulraj , Tom Rini 

+alias ti uboot, Tom Rini 
 
 alias avr32  uboot, Andreas Bießmann 
 
-- 
1.7.9.5

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


[U-Boot] [PATCH 5/5] pci: add CONFIG_PCI_ENUM_ONLY for platforms that don't need PCI setup done

2012-08-01 Thread Andrew Sharp
Introduce CONFIG_PCI_ENUM_ONLY variable for platforms that just want a
quick enumberation of the PCI devices, but don't need any setup work done.
This is very beneficial on platforms that have u-boot loaded by another
boot loader which does a more sophisticated job of setup of PCI devices
than u-boot.  That way, u-boot can just read what's there and get on
with life.  This is what SeaBIOS does.

Signed-off-by: Andrew Sharp 
---
 README |7 +++
 drivers/pci/pci_auto.c |   36 ++--
 2 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/README b/README
index dac46f3..3155391 100644
--- a/README
+++ b/README
@@ -3370,6 +3370,13 @@ Low Level (hardware related) configuration options:
Disable PCI-Express on systems where it is supported but not
required.
 
+- CONFIG_PCI_ENUM_ONLY
+   Only scan through and get the devices on the busses.
+   Don't do any setup work, presumably because someone or
+   something has already done it, and we don't need to do it
+   a second time.  Useful for platforms that are pre-booted
+   by coreboot or similar.
+
 - CONFIG_SYS_SRIO:
Chip has SRIO or not
 
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index dde252f..82c8855 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -90,32 +90,40 @@ void pciauto_setup_device(struct pci_controller *hose,
  struct pci_region *io)
 {
pci_addr_t bar_response;
-   pci_addr_t bar_value;
pci_size_t bar_size;
u16 cmdstat = 0;
-   struct pci_region *bar_res;
int bar, bar_nr = 0;
+#ifndef CONFIG_PCI_ENUM_ONLY
+   pci_addr_t bar_value;
+   struct pci_region *bar_res;
int found_mem64 = 0;
+#endif
 
pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat);
cmdstat = (cmdstat & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) | 
PCI_COMMAND_MASTER;
 
for (bar = PCI_BASE_ADDRESS_0; bar < PCI_BASE_ADDRESS_0 + (bars_num * 
4); bar += 4) {
/* Tickle the BAR and get the response */
+#ifndef CONFIG_PCI_ENUM_ONLY
pci_hose_write_config_dword(hose, dev, bar, 0x);
+#endif
pci_hose_read_config_dword(hose, dev, bar, &bar_response);
 
/* If BAR is not implemented go to the next BAR */
if (!bar_response)
continue;
 
+#ifndef CONFIG_PCI_ENUM_ONLY
found_mem64 = 0;
+#endif
 
/* Check the BAR type and set our address mask */
if (bar_response & PCI_BASE_ADDRESS_SPACE) {
bar_size = ((~(bar_response & PCI_BASE_ADDRESS_IO_MASK))
   & 0x) + 1;
+#ifndef CONFIG_PCI_ENUM_ONLY
bar_res = io;
+#endif
 
DEBUGF("PCI Autoconfig: BAR %d, I/O, size=0x%llx, ", 
bar_nr, (u64)bar_size);
} else {
@@ -123,24 +131,32 @@ void pciauto_setup_device(struct pci_controller *hose,
 PCI_BASE_ADDRESS_MEM_TYPE_64) {
u32 bar_response_upper;
u64 bar64;
+
+#ifndef CONFIG_PCI_ENUM_ONLY
pci_hose_write_config_dword(hose, dev, bar+4, 
0x);
+#endif
pci_hose_read_config_dword(hose, dev, bar+4, 
&bar_response_upper);
 
bar64 = ((u64)bar_response_upper << 32) | 
bar_response;
 
bar_size = ~(bar64 & PCI_BASE_ADDRESS_MEM_MASK) 
+ 1;
+#ifndef CONFIG_PCI_ENUM_ONLY
found_mem64 = 1;
+#endif
} else {
bar_size = (u32)(~(bar_response & 
PCI_BASE_ADDRESS_MEM_MASK) + 1);
}
+#ifndef CONFIG_PCI_ENUM_ONLY
if (prefetch && (bar_response & 
PCI_BASE_ADDRESS_MEM_PREFETCH))
bar_res = prefetch;
else
bar_res = mem;
+#endif
 
DEBUGF("PCI Autoconfig: BAR %d, Mem, size=0x%llx, ", 
bar_nr, (u64)bar_size);
}
 
+#ifndef CONFIG_PCI_ENUM_ONLY
if (pciauto_region_allocate(bar_res, bar_size, &bar_value) == 
0) {
/* Write it out and update our limit */
pci_hose_write_config_dword(hose, dev, bar, 
(u32)bar_value);
@@ -159,9 +175,11 @@ void pciauto_setup_device(struct pci_controller *hose,
 #endif
}
 
-   cmdstat |= (bar_response & PCI_BASE_ADDRESS_SPACE) ?
-   PCI_COMMAND_IO : PCI_COMMAND_MEMORY;
}
+#endif
+
+   cmdstat |= (bar_response & PCI_BASE_ADDRESS_SPACE) ?
+   PCI_COMMAND_IO : PCI_COMMAND_MEMORY;
 

Re: [U-Boot] [PATCH v3 3/7] dfu: DFU backend implementation

2012-08-01 Thread Mike Frysinger
On Tuesday 31 July 2012 02:36:59 Lukasz Majewski wrote:
> --- /dev/null
> +++ b/drivers/dfu/dfu.c
>
> +static int dfu_find_alt_num(char *s)

const char *s

> +{
> + int i = 0;
> +
> + for (; *s; s++)
> + if (*s == ';')
> + i++;
> +
> + return ++i;
> +}

looks kind of like:
return (strrchr(s, ';') - s) + 1;

> +int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
> +{
> + static unsigned char *i_buf;
> + static int i_blk_seq_num;
> + long w_size = 0;
> + int ret = 0;
> +
> + if (blk_seq_num == 0) {
> + memset(dfu_buf, '\0', sizeof(dfu_buf));
> ...
> + memcpy(i_buf, buf, size);
> + i_buf += size;

why bother clearing it ?  since right below we memcpy() in the data we care 
about from buf, i'd skip the memset() completely.

> +int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
> +{
> + static unsigned char *i_buf;
> + static int i_blk_seq_num;
> + static long r_size;
> + static u32 crc;
> + int ret = 0;
> +
> + if (blk_seq_num == 0) {
> + i_buf = dfu_buf;
> + memset(dfu_buf, '\0', sizeof(dfu_buf));
> + ret = dfu->read_medium(dfu, i_buf, &r_size);
> + debug("%s: %s %ld [B]\n", __func__, dfu->name, r_size);
> + i_blk_seq_num = 0;
> + /* Integrity check (if needed) */
> + crc = crc32(0, dfu_buf, r_size);
> + }

same here -- punt the memset()

> +static int dfu_fill_entity(struct dfu_entity *dfu, char* s, int alt,

"char *s", not "char* s"

> +int dfu_config_entities(char *env, char *interface, int num)
> +{
> + struct dfu_entity *dfu;
> + int i, ret;
> + char *s;
> +
> + dfu_alt_num = dfu_find_alt_num(env);
> + debug("%s: dfu_alt_num=%d\n", __func__, dfu_alt_num);
> +
> + for (i = 0; i < dfu_alt_num; i++) {
> + dfu = calloc(sizeof(struct dfu_entity), 1);

seems like you can do this in a single call outside of the for loop:
dfu = calloc(sizeof(*dfu), dfu_alt_num);
if (!dfu)
return -1;
for (i = 0; i < dfu_alt_num; i++) {
s = strsep(&env, ";");
ret = dfu_fill_entity(&dfu[i], s, i, interface, num);
if (ret)
return -1;
list_add_tail(&dfu[i].list, &dfu_list);
}

> --- /dev/null
> +++ b/include/dfu.h
>
> +char *dfu_extract_token(char** e, int *n);
> +extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char* s);
> +static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char* s)

"char *s", not "char* s"
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/2] tools, config.mk: add binutils-version

2012-08-01 Thread Graeme Russ
Hi Allen,

On Thu, Aug 2, 2012 at 8:46 AM, Allen Martin  wrote:

[snip]

> As the original author I don't really care either way, I only care
> about working around the assembler bug so I can turn on thumb for
> tegra.  But maybe I'll rewrite it in prolog just to mess with you guys
> :^)

Honestly, I prefer the original version - It clearly shows what the code
is doing. I'm not an awk god, and I find it really difficult to figure
out what half of the fancy scripts littered about the Makefiles actually
do. If it doesn't impact on performance, I prefer clarity (to non awk
god-like creatures) the compactness.

Just my $0.02 worth

Regards,

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


[U-Boot] [PATCH 3/5] pci: minor cleanup of CONFIG_PCI_PNP usage

2012-08-01 Thread Andrew Sharp
Refactor the common PCI code just a tiny bit surrounding the PCI_PNP
(pciauto) stuff.  Makes the code a tiny bit easier to read, and also
makes it more obvious that almost no platform needs to setup or use the
pci_config_table stuff.

Signed-off-by: Andrew Sharp 
---
 drivers/pci/pci.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f18d49e..1f5b8d7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -622,8 +622,10 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
unsigned int sub_bus, found_multi = 0;
unsigned short vendor, device, class;
unsigned char header_type;
-   struct pci_config_table *cfg;
pci_dev_t dev;
+#ifndef CONFIG_PCI_PNP
+   struct pci_config_table *cfg;
+#endif
 #ifdef CONFIG_PCI_SCAN_SHOW
static int indent = 0;
 #endif
@@ -669,18 +671,16 @@ int pci_hose_scan_bus(struct pci_controller *hose, int 
bus)
}
 #endif
 
+#ifdef CONFIG_PCI_PNP
+   sub_bus = max(pciauto_config_device(hose, dev), sub_bus);
+#else
cfg = pci_find_config(hose, class, vendor, device,
  PCI_BUS(dev), PCI_DEV(dev), 
PCI_FUNC(dev));
if (cfg) {
cfg->config_device(hose, dev, cfg);
sub_bus = max(sub_bus, hose->current_busno);
-#ifdef CONFIG_PCI_PNP
-   } else {
-   int n = pciauto_config_device(hose, dev);
-
-   sub_bus = max(sub_bus, n);
-#endif
}
+#endif
 
 #ifdef CONFIG_PCI_SCAN_SHOW
indent--;
-- 
1.7.1

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


[U-Boot] [PATCH 4/5] pci: update pci_ids.h with a few new entries

2012-08-01 Thread Andrew Sharp
Add some recent entries to pci_ids.h for Intel and AMD/ATI devices that
are somewhat relevant to u-boot.

Signed-off-by: Andrew Sharp 
---
 include/pci_ids.h |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/pci_ids.h b/include/pci_ids.h
index 6a85c06..df902f9 100644
--- a/include/pci_ids.h
+++ b/include/pci_ids.h
@@ -364,6 +364,10 @@
 #define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
 #define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
 #define PCI_DEVICE_ID_ATI_RS480 0x5950
+/* additional Radeon families */
+#define PCI_DEVICE_ID_ATI_EVERGREEN 0x9802
+#define PCI_DEVICE_ID_ATI_EVERGREEN20x9804
+#define PCI_DEVICE_ID_ATI_WRESTLER  0x9806
 /* ATI IXP Chipset */
 #define PCI_DEVICE_ID_ATI_IXP200_IDE   0x4349
 #define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
@@ -375,9 +379,13 @@
 #define PCI_DEVICE_ID_ATI_IXP400_SATA   0x4379
 #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
 #define PCI_DEVICE_ID_ATI_IXP600_SATA  0x4380
+#define PCI_DEVICE_ID_ATI_SBX00_PCI_BRIDGE 0x4384
 #define PCI_DEVICE_ID_ATI_SBX00_SMBUS  0x4385
 #define PCI_DEVICE_ID_ATI_IXP600_IDE   0x438c
 #define PCI_DEVICE_ID_ATI_IXP700_SATA  0x4390
+#define PCI_DEVICE_ID_ATI_SBX00_SATA_AHCI  0x4391
+#define PCI_DEVICE_ID_ATI_SBX00_EHCI   0x4396
+#define PCI_DEVICE_ID_ATI_SBX00_OHCI   0x4397
 #define PCI_DEVICE_ID_ATI_IXP700_IDE   0x439c
 
 #define PCI_VENDOR_ID_VLSI 0x1004
@@ -2539,9 +2547,16 @@
 #define PCI_DEVICE_ID_INTEL_82840_HB   0x1a21
 #define PCI_DEVICE_ID_INTEL_82845_HB   0x1a30
 #define PCI_DEVICE_ID_INTEL_IOAT   0x1a38
+#define PCI_DEVICE_ID_INTEL_COUGARPOINT_AHCI_MOBILE0x1c03
+#define PCI_DEVICE_ID_INTEL_COUGARPOINT_AHCI_SERIES6   0x1c02
+#define PCI_DEVICE_ID_INTEL_COUGARPOINT_HDA0x1c20
 #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS  0x1c22
 #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN0x1c41
 #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX0x1c5f
+#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_AHCI_MOBILE   0x1e03
+#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_HDA   0x1e20
+#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MIN 0x1e41
+#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MAX 0x1e5f
 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22
 #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC   0x1d40
 #define PCI_DEVICE_ID_INTEL_82801AA_0  0x2410
@@ -2635,6 +2650,7 @@
 #define PCI_DEVICE_ID_INTEL_ICH7_300x27b0
 #define PCI_DEVICE_ID_INTEL_TGP_LPC0x27bc
 #define PCI_DEVICE_ID_INTEL_ICH7_310x27bd
+#define PCI_DEVICE_ID_INTEL_NM10_AHCI  0x27c1
 #define PCI_DEVICE_ID_INTEL_ICH7_170x27da
 #define PCI_DEVICE_ID_INTEL_ICH7_190x27dd
 #define PCI_DEVICE_ID_INTEL_ICH7_200x27de
-- 
1.7.1

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


[U-Boot] [PATCH 2/5] [cosmetic] pci: clean up some whitespace and formatting

2012-08-01 Thread Andrew Sharp
I tried to clean up the white space and formatting offenses and
inconsistencies in the generic PCI code that obviously has been around for
some time.  Emphasis on large increases in readability and maintainability
and consistency.  I omitted the platform/processor specific files in
the drivers/pci directory because I wanted to leave those file to those
that care more about them, and because none of my follow-on patches
touch the non-generic code.

Signed-off-by: Andrew Sharp 
---
 drivers/pci/pci.c  |  121 
 drivers/pci/pci_auto.c |   56 +--
 2 files changed, 93 insertions(+), 84 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index cd78312..f18d49e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -151,13 +151,14 @@ void pci_register_hose(struct pci_controller* hose)
*phose = hose;
 }
 
-struct pci_controller *pci_bus_to_hose (int bus)
+struct pci_controller *pci_bus_to_hose(int bus)
 {
struct pci_controller *hose;
 
-   for (hose = hose_head; hose; hose = hose->next)
+   for (hose = hose_head; hose; hose = hose->next) {
if (bus >= hose->first_busno && bus <= hose->last_busno)
return hose;
+   }
 
printf("pci_bus_to_hose() failed\n");
return NULL;
@@ -196,52 +197,44 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int 
index)
pci_dev_t bdf;
int i, bus, found_multi = 0;
 
-   for (hose = hose_head; hose; hose = hose->next)
-   {
+   for (hose = hose_head; hose; hose = hose->next) {
 #ifdef CONFIG_SYS_SCSI_SCAN_BUS_REVERSE
for (bus = hose->last_busno; bus >= hose->first_busno; bus--)
 #else
for (bus = hose->first_busno; bus <= hose->last_busno; bus++)
 #endif
-   for (bdf = PCI_BDF(bus,0,0);
+   for (bdf = PCI_BDF(bus, 0, 0);
 #if defined(CONFIG_ELPPC) || defined(CONFIG_PPMC7XX)
-bdf < 
PCI_BDF(bus,PCI_MAX_PCI_DEVICES-1,PCI_MAX_PCI_FUNCTIONS-1);
+   bdf < PCI_BDF(bus, PCI_MAX_PCI_DEVICES - 1,
+   PCI_MAX_PCI_FUNCTIONS - 1);
 #else
-bdf < PCI_BDF(bus+1,0,0);
+   bdf < PCI_BDF(bus+1,0,0);
 #endif
-bdf += PCI_BDF(0,0,1))
-   {
-   if (!PCI_FUNC(bdf)) {
-   pci_read_config_byte(bdf,
-PCI_HEADER_TYPE,
-&header_type);
+   bdf += PCI_BDF(0,0,1)) {
 
+   if (!PCI_FUNC(bdf)) {
+   pci_read_config_byte(bdf, 
PCI_HEADER_TYPE, &header_type);
found_multi = header_type & 0x80;
} else {
if (!found_multi)
continue;
}
 
-   pci_read_config_word(bdf,
-PCI_VENDOR_ID,
-&vendor);
-   pci_read_config_word(bdf,
-PCI_DEVICE_ID,
-&device);
-
-   for (i=0; ids[i].vendor != 0; i++)
-   if (vendor == ids[i].vendor &&
-   device == ids[i].device)
-   {
+   pci_read_config_word(bdf, PCI_VENDOR_ID, 
&vendor);
+   pci_read_config_word(bdf, PCI_DEVICE_ID, 
&device);
+
+   for (i = 0; ids[i].vendor != 0; i++) {
+   if (vendor == ids[i].vendor && device 
== ids[i].device) {
if (index <= 0)
return bdf;
 
index--;
}
+   }
}
}
 
-   return (-1);
+   return -1;
 }
 
 pci_dev_t pci_find_device(unsigned int vendor, unsigned int device, int index)
@@ -258,7 +251,7 @@ pci_dev_t pci_find_device(unsigned int vendor, unsigned int 
device, int index)
  *
  */
 
-int __pci_hose_phys_to_bus (struct pci_controller *hose,
+int __pci_hose_phys_to_bus(struct pci_controller *hose,
phys_addr_t phys_addr,
unsigned long flags,
unsigned long skip_mask,
@@ -289,7 +282

[U-Boot] [PATCH 1/5] pci: fix errant data types and corresponding access functions

2012-08-01 Thread Andrew Sharp
In a couple of places, unsigned int and pci_config_*_dword were being
used when u16 and _word should be used.  Unsigned int was also being
used in a couple of places that should be pci_addr_t.

Signed-off-by: Andrew Sharp 
---
 drivers/pci/pci.c  |7 ---
 drivers/pci/pci_auto.c |   15 ---
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 398542b..cd78312 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -118,11 +118,11 @@ PCI_WRITE_VIA_DWORD_OP(word, u16, 0x02, 0x)
 void *pci_map_bar(pci_dev_t pdev, int bar, int flags)
 {
pci_addr_t pci_bus_addr;
-   u32 bar_response;
+   pci_addr_t bar_response;
 
/* read BAR address */
pci_read_config_dword(pdev, bar, &bar_response);
-   pci_bus_addr = (pci_addr_t)(bar_response & ~0xf);
+   pci_bus_addr = bar_response & ~0xf;
 
/*
 * Pass "0" as the length argument to pci_bus_to_virt.  The arg
@@ -385,7 +385,8 @@ int pci_hose_config_device(struct pci_controller *hose,
   pci_addr_t mem,
   unsigned long command)
 {
-   unsigned int bar_response, old_command;
+   pci_addr_t bar_response;
+   unsigned int old_command;
pci_addr_t bar_value;
pci_size_t bar_size;
unsigned char pin;
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index 87ee2c2..2338706 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -88,15 +88,15 @@ void pciauto_setup_device(struct pci_controller *hose,
  struct pci_region *prefetch,
  struct pci_region *io)
 {
-   unsigned int bar_response;
+   pci_addr_t bar_response;
pci_addr_t bar_value;
pci_size_t bar_size;
-   unsigned int cmdstat = 0;
+   u16 cmdstat = 0;
struct pci_region *bar_res;
int bar, bar_nr = 0;
int found_mem64 = 0;
 
-   pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
+   pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat);
cmdstat = (cmdstat & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) | 
PCI_COMMAND_MASTER;
 
for (bar = PCI_BASE_ADDRESS_0; bar < PCI_BASE_ADDRESS_0 + (bars_num*4); 
bar += 4) {
@@ -167,7 +167,7 @@ void pciauto_setup_device(struct pci_controller *hose,
bar_nr++;
}
 
-   pci_hose_write_config_dword(hose, dev, PCI_COMMAND, cmdstat);
+   pci_hose_write_config_word(hose, dev, PCI_COMMAND, cmdstat);
pci_hose_write_config_byte(hose, dev, PCI_CACHE_LINE_SIZE,
CONFIG_SYS_PCI_CACHE_LINE_SIZE);
pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
@@ -179,9 +179,9 @@ void pciauto_prescan_setup_bridge(struct pci_controller 
*hose,
struct pci_region *pci_mem = hose->pci_mem;
struct pci_region *pci_prefetch = hose->pci_prefetch;
struct pci_region *pci_io = hose->pci_io;
-   unsigned int cmdstat;
+   u16 cmdstat;
 
-   pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
+   pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat);
 
/* Configure bus number registers */
pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS,
@@ -229,7 +229,8 @@ void pciauto_prescan_setup_bridge(struct pci_controller 
*hose,
}
 
/* Enable memory and I/O accesses, enable bus master */
-   pci_hose_write_config_dword(hose, dev, PCI_COMMAND, cmdstat | 
PCI_COMMAND_MASTER);
+   pci_hose_write_config_word(hose, dev, PCI_COMMAND,
+   cmdstat | PCI_COMMAND_MASTER);
 }
 
 void pciauto_postscan_setup_bridge(struct pci_controller *hose,
-- 
1.7.1

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


[U-Boot] [PATCH 0/5] light updates of common pci code; some pci ids

2012-08-01 Thread Andrew Sharp
[PATCH 1/5] pci: fix errant data types and corresponding access functions
[PATCH 2/5] [cosmetic] pci: clean up some whitespace and formatting
[PATCH 3/5] pci: minor cleanup of CONFIG_PCI_PNP usage
[PATCH 4/5] pci: update pci_ids.h with a few new entries
[PATCH 5/5] pci: add CONFIG_PCI_ENUM_ONLY for platforms that don't need PCI 
setup done
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/2] tools, config.mk: add binutils-version

2012-08-01 Thread Allen Martin
On Wed, Aug 01, 2012 at 03:31:37PM -0700, Mike Frysinger wrote:
> On Thursday 19 July 2012 12:54:37 Tom Rini wrote:
> > On 07/19/2012 09:43 AM, Mike Frysinger wrote:
> > > On Thursday 19 July 2012 11:38:39 Tom Rini wrote:
> > >> On 07/19/2012 08:21 AM, Mike Frysinger wrote:
> > >>> On Thursday 19 July 2012 11:08:10 Tom Rini wrote:
> >  On 07/18/2012 08:11 PM, Mike Frysinger wrote:
> > > On Wednesday 18 July 2012 19:45:52 Allen Martin wrote:
> > >> +MAJOR=$($gas --version | head -1 | awk '{print $NF}' |
> > >> cut -d . -f 1) +MINOR=$($gas --version | head -1 | awk
> > >> '{print $NF}' | cut -d . -f 2) + +printf "%02d%02d\\n"
> > >> $MAJOR $MINOR
> > > 
> > > can be replaced with a single awk script:
> > > 
> > > $gas --version | awk '{ gsub(/[.]/, " ", $NF) $0 = $NF
> > > printf "%02d%02d\n", $1, $2 exit }'
> >  
> >  That looks much longer and we call this once so a few execs
> >  is noise.
> > >>> 
> > >>> here's a shorter version: $gas --version | awk '{ gsub(/[.]/, "
> > >>> ", $NF); $0 = $NF; printf "%02d%02d\n", $1, $2; exit }'
> > >> 
> > >> And still over 80 chars before we assign it to a variable.  I
> > >> could get it to 77 chars with all whitespace removed.
> > > 
> > > which is why i unrolled it to make it readable.  i don't know what
> > > metrics you're using here, but i don't think the awk version is
> > > "longer" by really any of them.
> > 
> > The metric of 'wc -c' and "what fits in a single line, unwrapped on an
> > 80x24 terminal."  awk is great and awesome, don't get me wrong, but
> > it's not doing the job as compactly as the original.
> 
> obviously i disagree.  i find the awk version "better" in just about every 
> way.  
> maybe someone else will jump in with their favorite bike.

As the original author I don't really care either way, I only care
about working around the assembler bug so I can turn on thumb for
tegra.  But maybe I'll rewrite it in prolog just to mess with you guys
:^)

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


Re: [U-Boot] [PATCH v3 2/7] dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget

2012-08-01 Thread Mike Frysinger
On Tuesday 31 July 2012 02:36:58 Lukasz Majewski wrote:
> --- /dev/null
> +++ b/drivers/usb/gadget/f_dfu.c
>
> +static struct usb_interface_descriptor dfu_intf_runtime = {

can this be made const ?

> +static struct usb_descriptor_header *dfu_runtime_descs[] = {
> + (struct usb_descriptor_header *) &dfu_intf_runtime,

can you change the descs array to be const ?
static const struct usb_descriptor_header * const dfu_runtime_descs[] = {

then i think you can drop the cast there ...

> +static struct usb_qualifier_descriptor dev_qualifier = {
> +static struct usb_gadget_strings stringtab_dfu_generic = {
> +static struct usb_gadget_strings *dfu_generic_strings[] = {
> +static struct usb_gadget_strings stringtab_dfu = {
> +static struct usb_gadget_strings *dfu_strings[] = {

can these be made const ?

> +static void handle_getstate(struct usb_request *req)
> +{
> + struct f_dfu *f_dfu = req->context;
> +
> + ((u8 *)req->buf)[0] = f_dfu->dfu_state & 0xff;

pretty sure you don't need that "& 0xff"

> +static int state_app_idle(struct f_dfu *f_dfu,
> +   const struct usb_ctrlrequest *ctrl,
> +   struct usb_gadget *gadget,
> +   struct usb_request *req)
> +{
> + int value = 0;

might be good to push this down into the 1 case statement 
(USB_REQ_DFU_GETSTATE) that uses it rather than init it up top

same goes for all the other funcs below that follow this style
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/7] dfu:usb: Support for g_dnl composite download gadget.

2012-08-01 Thread Mike Frysinger
On Tuesday 31 July 2012 02:36:57 Lukasz Majewski wrote:
> --- /dev/null
> +++ b/drivers/usb/gadget/g_dnl.c
>
> +static const struct usb_descriptor_header *otg_desc[] = {
> + (struct usb_descriptor_header *) &(struct usb_otg_descriptor){

since you're just casting away things, you could just use (void*) to make it a 
bit more compact

also, can this be:
static const struct usb_descriptor_header * const otg_desc[]
(notice the 2nd const)

> +static struct usb_gadget_strings *g_dnl_composite_strings[] = {

here too:
static struct usb_gadget_strings * const g_dnl_composite_strings[] = {

> +static int g_dnl_do_config(struct usb_configuration *c)
> +{
> + int ret = -1;
> + char *s = (char *) c->cdev->driver->name;

pretty sure this should be:
const char *s = c->cdev->driver->name;

> +static int g_dnl_bind(struct usb_composite_dev *cdev)
> +{
> + int gcnum;
> + int id, ret;
> + struct usb_gadget   *gadget = cdev->gadget;

can we stick to a single space for indentation between the type and the 
variable name please ?

> +int g_dnl_register(const char *type)
> +{
> + int ret;
> + /* We only allow "dfu" atm, so 3 should be enough */
> + static char name[sizeof(shortname) + 3];
> +
> + if (!strcmp(type, "dfu")) {
> + strcpy(name, shortname);
> + strcat(name, type);

if u-boot had stpcpy(), we could do:
strcpy(stpcpy(name, shortname), type);

> --- /dev/null
> +++ b/include/g_dnl.h
>
> +/* USB initialization declaration - board specific*/

needs a space before that "*/"
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/2] tools, config.mk: add binutils-version

2012-08-01 Thread Mike Frysinger
On Thursday 19 July 2012 12:54:37 Tom Rini wrote:
> On 07/19/2012 09:43 AM, Mike Frysinger wrote:
> > On Thursday 19 July 2012 11:38:39 Tom Rini wrote:
> >> On 07/19/2012 08:21 AM, Mike Frysinger wrote:
> >>> On Thursday 19 July 2012 11:08:10 Tom Rini wrote:
>  On 07/18/2012 08:11 PM, Mike Frysinger wrote:
> > On Wednesday 18 July 2012 19:45:52 Allen Martin wrote:
> >> +MAJOR=$($gas --version | head -1 | awk '{print $NF}' |
> >> cut -d . -f 1) +MINOR=$($gas --version | head -1 | awk
> >> '{print $NF}' | cut -d . -f 2) + +printf "%02d%02d\\n"
> >> $MAJOR $MINOR
> > 
> > can be replaced with a single awk script:
> > 
> > $gas --version | awk '{ gsub(/[.]/, " ", $NF) $0 = $NF
> > printf "%02d%02d\n", $1, $2 exit }'
>  
>  That looks much longer and we call this once so a few execs
>  is noise.
> >>> 
> >>> here's a shorter version: $gas --version | awk '{ gsub(/[.]/, "
> >>> ", $NF); $0 = $NF; printf "%02d%02d\n", $1, $2; exit }'
> >> 
> >> And still over 80 chars before we assign it to a variable.  I
> >> could get it to 77 chars with all whitespace removed.
> > 
> > which is why i unrolled it to make it readable.  i don't know what
> > metrics you're using here, but i don't think the awk version is
> > "longer" by really any of them.
> 
> The metric of 'wc -c' and "what fits in a single line, unwrapped on an
> 80x24 terminal."  awk is great and awesome, don't get me wrong, but
> it's not doing the job as compactly as the original.

obviously i disagree.  i find the awk version "better" in just about every way. 
 
maybe someone else will jump in with their favorite bike.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 8/9] arm: use thumb interworking returns in libgcc

2012-08-01 Thread Allen Martin
On Wed, Aug 01, 2012 at 03:15:45PM -0700, V, Aneesh wrote:
> > I didn't want to break any older ARM architectures that don't support the
> > bx instruction but use this code.
> 
> 
> Which is earlier than armv4t, right? On quick look it didn't seem there is 
> anything
> older than that in u-boot. But yes, it's perhaps better to be safe.

Yes, in particular bx is available in armv4t but not armv4, and there
are architectures being compiled -march=armv4 in u-boot:

$ grep march arch/arm/cpu/*/config.mk
arch/arm/cpu/arm1136/config.mk:PLATFORM_CPPFLAGS += -march=armv5
arch/arm/cpu/arm1176/config.mk:PLATFORM_CPPFLAGS += -march=armv5t
arch/arm/cpu/arm720t/config.mk:PLATFORM_CPPFLAGS += -march=armv4
-mtune=arm7tdmi
arch/arm/cpu/arm920t/config.mk:PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/arm925t/config.mk:PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/arm926ejs/config.mk:PLATFORM_CPPFLAGS += -march=armv5te
arch/arm/cpu/arm946es/config.mk:PLATFORM_CPPFLAGS +=  -march=armv4
arch/arm/cpu/arm_intcm/config.mk:PLATFORM_CPPFLAGS +=  -march=armv4
arch/arm/cpu/armv7/config.mk:PF_CPPFLAGS_ARMV7 := $(call cc-option,
-march=armv7-a, -march=armv5)
arch/arm/cpu/ixp/config.mk:PLATFORM_CPPFLAGS += -mbig-endian
-march=armv5te -mtune=strongarm1100
arch/arm/cpu/lh7a40x/config.mk:PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/pxa/config.mk:PLATFORM_CPPFLAGS += -march=armv5te
-mtune=xscale
arch/arm/cpu/s3c44b0/config.mk:PLATFORM_CPPFLAGS += -march=armv4
-mtune=arm7tdmi -msoft-float
arch/arm/cpu/sa1100/config.mk:PLATFORM_CPPFLAGS += -march=armv4
-mtune=strongarm1100

Probably some of these are actually armv4t, but I don't want to touch
them :^)

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


Re: [U-Boot] [PATCH v2 8/9] arm: use thumb interworking returns in libgcc

2012-08-01 Thread V, Aneesh
Hi Allen,

On Wed, Aug 1, 2012 at 2:55 PM, Allen Martin  wrote:

> On Wed, Aug 01, 2012 at 02:11:48PM -0700, V, Aneesh wrote:
> > Hi Allen,
> >
> > On Wed, Aug 1, 2012 at 1:32 PM, Allen Martin  amar...@nvidia.com>> wrote:
> > If CONFIG_SYS_THUMB_BUILD is enabled, use thumb interworking return
> > instructions from libgcc routines, otherwise use ARM returns.
> >
> > Signed-off-by: Allen Martin  amar...@nvidia.com>>
> > ---
> >  arch/arm/include/asm/assembler.h |   10 ++
> >  arch/arm/lib/_ashldi3.S  |3 ++-
> >  arch/arm/lib/_ashrdi3.S  |3 ++-
> >  arch/arm/lib/_divsi3.S   |   15 +++
> >  arch/arm/lib/_lshrdi3.S  |3 ++-
> >  arch/arm/lib/_modsi3.S   |9 -
> >  arch/arm/lib/_udivsi3.S  |8 +---
> >  arch/arm/lib/_umodsi3.S  |   18 +-
> >  arch/arm/lib/memcpy.S|   10 ++
> >  arch/arm/lib/memset.S|3 ++-
> >  10 files changed, 69 insertions(+), 13 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/assembler.h
> b/arch/arm/include/asm/assembler.h
> > index 5e4789b..25ece01 100644
> > --- a/arch/arm/include/asm/assembler.h
> > +++ b/arch/arm/include/asm/assembler.h
> > @@ -13,6 +13,7 @@
> >   *  Do not include any C declarations in this file - it is included by
> >   *  assembler source.
> >   */
> > +#include 
> >
> >  /*
> >   * Endian independent macros for shifting bytes within registers.
> > @@ -58,3 +59,12 @@
> >   * Cache alligned
> >   */
> >  #define CALGN(code...) code
> > +
> > +/*
> > + * return instruction
> > + */
> > +#ifdef CONFIG_SYS_THUMB_BUILD
> > +#define RETbx  lr
> > +#else
> > +#define RETmov pc, lr
> >
> > Why not "bx lr" in all cases? In that case you can just replace all the
> instances of
> > "mov pc, lr" directly by "bx lr" instead of this macro. That looks
> cleaner to me.
>
> I didn't want to break any older ARM architectures that don't support the
> bx instruction but use this code.
>
>
Which is earlier than armv4t, right? On quick look it didn't seem there is
anything
older than that in u-boot. But yes, it's perhaps better to be safe.


>
> > BTW, as far as I remember when I did this originally my compiler was
> compiling
> > all assembly functions in ARM and it was automatically converting "mov
> pc, lr" to
> > "bx lr" ,where necessary. Maybe that was just my compiler and I don't
> remember
> > the details now. Did you really face any issue with "mov pc, lr" making
> wrong jumps?
>
> Yes, without this change if I disassemble the code I'm seeing it's
> still a mov instruction and it hangs.
>
>
Ok.

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


Re: [U-Boot] early_malloc outline

2012-08-01 Thread Tomas Hlavacek
Dear Wolfgang,

On Wed, Aug 1, 2012 at 9:09 PM, Wolfgang Denk  wrote:

> Hm... I have to admit that I am not really happy about such an
> "explanation".  The statement that "other guys" want something is not
> exactly an explanation of a concept that I can understand, and without
> being able to understand it, I don't buy it.

I wanted to say that this is outcome of an informal discussion with
Marek Vasut, Pavel Hermann and Viktor Krivak, who are working on
different parts of DM (and perhaps I should say that it is our school
project to implement driver model for U-Boot, which is not relevant
information to the current discussion, but it may explain why we
closely cooperate on DM among ourselves). Statements like "I/we want"
were not any notices nor decisions nor whatever final but rather
wishes or ideas (mine or from others). Although we have elaborate
outline of DM and supporting subsystems it is still subject to
changes.

> But why would 2 copies be needed?  I understand then once regular
> malloc() becomes available, you want to make sure all allocations are
> maintained using this mechanism.  But I already wonder how you are
> going to implement this - you will have to update all pointers.  How
> will you find out where these might be?
>
> Assume something like:
>
> item *foo(...)
> {
> static item *foo_local = malloc(size1);
> ...
> return foo_local;
> }
>
> item *bar(..., item **ptr)
> {
> static item *bar_local = malloc(size2);
> ...
> *ptr = bar_local;
> return bar_local;
> }
>
> void some_function(...)
> {
> item *x, *y;
> ...
> x = bar(..., &y);
> baz(y);
> ...
> }
>
> How will you later know which variables store the values from the early
> malloc calls, and how will you access these for proper relocation?
>

Each early heap (assuming we can have more than one contiguous early
heaps as Graeme suggested) has a pointer to the beginning (and it is
valid only before relocation and before caches are enabled). I can
memcpy() the used part of the early heap somewhere else and preserve
the original heap beginning pointer (I have in mind preservation of
the pointers in GD; it is implementation detail indeed, but I would
rather note this in order make sure that I am not working with false
assumption about possibility of preserving pointers like that). Then I
can compute copied_heap_address = original_address +
(copied_heap_begin - original_heap_begin).

I have to admit, that I am not familiar enough with plans for early DM
tree to know where are we going to hold tree root pointer. I think
that it could be eventually placed in GD. To your example:

#define TRANSLATE_ADDR(old_heap,new_heap,pointer) (pointer + new_heap
- old_heap)

void some_function(...)
{
item *x, *y;
...
x = bar(..., &y);
baz(y);

gd->x = x;
gd->y = y;

...

memcpy(NEW_HEAP_ADDR, gd->old_heap_addr, heap_used_bytes);
}

void later(...)
{
item *x = TRANSLATE_ADDR(old_heap_addr,NEW_HEAP_ADDR,gd->x);
item *y = TRANSLATE_ADDR(old_heap_addr,NEW_HEAP_ADDR,gd->y);
}


Perhaps I can try to rewrite it into more real-life example:

void board_init_f(...)
{
...
struct dm_tree_node *root = malloc(sizeof(struct dm_tree_item));
/* early_malloc() has been used in fact. */
root->left_descendant = malloc(sizeof(struct dm_tree_item));
gd->dm_tree_root = root;
...

memcpy(NEW_HEAP_ADDR,gd->early_heap,gd->early_heap_used_bytes);

relocate_code(...);
}

void board_init_r(gd_t *id, ulong dest_addr)
{
...
struct dm_tree_node *root_new = TRANSLATE_ADDR(gd->early_heap,
NEW_HEAP_ADDR, gd->root);
root_new->left_descendant = TRANSLATE_ADDR(gd->early_heap,
NEW_HEAP_ADDR, root_new->left_descendant);

/* And I can rectify all the pointers in the tree just like that.
   It should not be expensive because the tree is really
   small at this point - 5 items max.
   The problem is, that the root_new does not point to memory
   obtained from dlmalloc. How could we possibily solve this? Our 
current
   idea is to perform one extra round of malloc() and copying of the 
tree...
*/
...
}

Thank you for your help,
Tomas

-- 
Tomáš Hlaváček 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 8/9] arm: use thumb interworking returns in libgcc

2012-08-01 Thread Allen Martin
On Wed, Aug 01, 2012 at 02:11:48PM -0700, V, Aneesh wrote:
> Hi Allen,
> 
> On Wed, Aug 1, 2012 at 1:32 PM, Allen Martin 
> mailto:amar...@nvidia.com>> wrote:
> If CONFIG_SYS_THUMB_BUILD is enabled, use thumb interworking return
> instructions from libgcc routines, otherwise use ARM returns.
> 
> Signed-off-by: Allen Martin mailto:amar...@nvidia.com>>
> ---
>  arch/arm/include/asm/assembler.h |   10 ++
>  arch/arm/lib/_ashldi3.S  |3 ++-
>  arch/arm/lib/_ashrdi3.S  |3 ++-
>  arch/arm/lib/_divsi3.S   |   15 +++
>  arch/arm/lib/_lshrdi3.S  |3 ++-
>  arch/arm/lib/_modsi3.S   |9 -
>  arch/arm/lib/_udivsi3.S  |8 +---
>  arch/arm/lib/_umodsi3.S  |   18 +-
>  arch/arm/lib/memcpy.S|   10 ++
>  arch/arm/lib/memset.S|3 ++-
>  10 files changed, 69 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/include/asm/assembler.h 
> b/arch/arm/include/asm/assembler.h
> index 5e4789b..25ece01 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -13,6 +13,7 @@
>   *  Do not include any C declarations in this file - it is included by
>   *  assembler source.
>   */
> +#include 
> 
>  /*
>   * Endian independent macros for shifting bytes within registers.
> @@ -58,3 +59,12 @@
>   * Cache alligned
>   */
>  #define CALGN(code...) code
> +
> +/*
> + * return instruction
> + */
> +#ifdef CONFIG_SYS_THUMB_BUILD
> +#define RETbx  lr
> +#else
> +#define RETmov pc, lr
> 
> Why not "bx lr" in all cases? In that case you can just replace all the 
> instances of
> "mov pc, lr" directly by "bx lr" instead of this macro. That looks cleaner to 
> me.

I didn't want to break any older ARM architectures that don't support the
bx instruction but use this code.


> BTW, as far as I remember when I did this originally my compiler was compiling
> all assembly functions in ARM and it was automatically converting "mov pc, 
> lr" to
> "bx lr" ,where necessary. Maybe that was just my compiler and I don't remember
> the details now. Did you really face any issue with "mov pc, lr" making wrong 
> jumps?

Yes, without this change if I disassemble the code I'm seeing it's
still a mov instruction and it hangs.

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


Re: [U-Boot] [PATCH 2/2] sf: stmicro: add support N25Q128 parts

2012-08-01 Thread Stephan Linz
Am Mittwoch, den 01.08.2012, 13:53 -0400 schrieb Mike Frysinger: 
> On Friday 13 July 2012 14:07:19 Stephan Linz wrote:
> > Adds support for Numonyx's N25Q128 SPI flash. These devices
> > are used on (among others) Avnet Spartan-6 LX9 micro-evaluation
> > boards. Tested with "sf" commands and CONFIG_ENV_IS_IN_SPI_FLASH.
> 
> needs to be rebased onto mainline.  looks fine otherwise.
> -mike

Hi Mike,

I'll do it at weekend together with the things you commented in the
second patch ...


br,
Stephan

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


[U-Boot] [PATCH] MAINTAINERS: fix Andreas Bießmann AVR32 entry

2012-08-01 Thread Andreas Bießmann
The grasshopper board is a avr32 based device and belongs therefore to the avr32
section.

Signed-off-by: Andreas Bießmann 
---
 MAINTAINERS | 4 +++-
 1 Datei geändert, 3 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c6f6fe8..ddf205e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -609,7 +609,6 @@ Rishi Bhattacharya 
 Andreas Bießmann 
 
at91rm9200ekat91rm9200
-   grasshopper avr32
 
 Cliff Brake 
 
@@ -1075,6 +1074,9 @@ Wolfgang Wegner 
 #  Board   CPU #
 #
 
+Andreas Bießmann 
+   grasshopper AT32AP7000
+
 Hans-Christian Egtvedt 
 
FAVR-32-EZKIT   AT32AP7000
-- 
1.7.11.3

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


Re: [U-Boot] [PATCH v2 8/9] arm: use thumb interworking returns in libgcc

2012-08-01 Thread V, Aneesh
Hi Allen,

On Wed, Aug 1, 2012 at 1:32 PM, Allen Martin  wrote:

> If CONFIG_SYS_THUMB_BUILD is enabled, use thumb interworking return
> instructions from libgcc routines, otherwise use ARM returns.
>
> Signed-off-by: Allen Martin 
> ---
>  arch/arm/include/asm/assembler.h |   10 ++
>  arch/arm/lib/_ashldi3.S  |3 ++-
>  arch/arm/lib/_ashrdi3.S  |3 ++-
>  arch/arm/lib/_divsi3.S   |   15 +++
>  arch/arm/lib/_lshrdi3.S  |3 ++-
>  arch/arm/lib/_modsi3.S   |9 -
>  arch/arm/lib/_udivsi3.S  |8 +---
>  arch/arm/lib/_umodsi3.S  |   18 +-
>  arch/arm/lib/memcpy.S|   10 ++
>  arch/arm/lib/memset.S|3 ++-
>  10 files changed, 69 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/include/asm/assembler.h
> b/arch/arm/include/asm/assembler.h
> index 5e4789b..25ece01 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -13,6 +13,7 @@
>   *  Do not include any C declarations in this file - it is included by
>   *  assembler source.
>   */
> +#include 
>
>  /*
>   * Endian independent macros for shifting bytes within registers.
> @@ -58,3 +59,12 @@
>   * Cache alligned
>   */
>  #define CALGN(code...) code
> +
> +/*
> + * return instruction
> + */
> +#ifdef CONFIG_SYS_THUMB_BUILD
> +#define RETbx  lr
> +#else
> +#define RETmov pc, lr
>

Why not "bx lr" in all cases? In that case you can just replace all the
instances of
"mov pc, lr" directly by "bx lr" instead of this macro. That looks cleaner
to me.

BTW, as far as I remember when I did this originally my compiler was
compiling
all assembly functions in ARM and it was automatically converting "mov pc,
lr" to
"bx lr" ,where necessary. Maybe that was just my compiler and I don't
remember
the details now. Did you really face any issue with "mov pc, lr" making
wrong jumps?

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


Re: [U-Boot] [PATCHv2] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-01 Thread Andreas Bießmann
Dear Markus Hubig,

On 01.08.12 21:57, Markus Hubig wrote:
> This adds support for the AT91SAM9G20 boards by taskit GmbH.
> Both boards, Stamp9G20 and PortuxG20, are integrated in one
> file. PortuxG20 is basically a SBC built around the Stamp9G20.
> 
> Signed-off-by: Markus Hubig 
> Cc: Andreas Bießmann 
> ---
>  MAINTAINERS|4 +
>  board/taskit/stamp9g20/Makefile|   52 +
>  board/taskit/stamp9g20/stamp9g20.c |  185 ++
>  boards.cfg |2 +
>  include/configs/stamp9g20.h|  216 
> 
>  5 files changed, 459 insertions(+), 0 deletions(-)
>  create mode 100644 board/taskit/stamp9g20/Makefile
>  create mode 100644 board/taskit/stamp9g20/stamp9g20.c
>  create mode 100644 include/configs/stamp9g20.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 84413de..649436d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -243,6 +243,10 @@ Klaus Heydeck 
>   KUP4K   MPC855
>   KUP4X   MPC859
>  
> +Markus Hubig 
> +
> + STAMP9G20   ARM926EJS
> +
>  Ilko Iliev 

unfortunately Ilko Iliev is wrong here ... this is the PPC section (all
these MPCxx). About line 566 begins the ARM section.

>  
>   PM9261  AT91SAM9261
> diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
> new file mode 100644
> index 000..e99bfaa
> --- /dev/null
> +++ b/board/taskit/stamp9g20/Makefile
> @@ -0,0 +1,52 @@
> +#
> +# (C) Copyright 2003-2008
> +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> +#
> +# (C) Copyright 2008
> +# Stelian Pop 
> +# Lead Tech Design 
> +#
> +# (C) Copyright 2012
> +# Markus Hubig 
> +# IMKO GmbH 
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  = $(obj)lib$(BOARD).o
> +
> +COBJS-y  += stamp9g20.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS-y))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/taskit/stamp9g20/stamp9g20.c 
> b/board/taskit/stamp9g20/stamp9g20.c
> new file mode 100644
> index 000..afb9449
> --- /dev/null
> +++ b/board/taskit/stamp9g20/stamp9g20.c
> @@ -0,0 +1,185 @@
> +/*
> + * (C) Copyright 2007-2008
> + * Stelian Pop 
> + * Lead Tech Design 
> + *
> + * Achim Ehrlich 
> + * taskit GmbH 
> + *
> + * (C) Copyright 2012-
> + * Markus Hubig 
> + * IMKO GmbH 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static void stamp9G20_nand_hw_init(void)
> +{
> + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
> + struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
> + unsigned long csa;
> +
> + /* Assign CS3 to NAND/SmartMedia Interface */
> + csa = readl(&matrix->ebicsa);
> + csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA;
> + writel

[U-Boot] [PATCH] MAINTAINERS: fix entry of Ilko Iliev

2012-08-01 Thread Andreas Bießmann
These boards have ARM cores, move to the ARM section.

Signed-off-by: Andreas Bießmann 
---
 MAINTAINERS | 12 ++--
 1 Datei geändert, 6 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7ee3d76..6c7b8b3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -243,12 +243,6 @@ Klaus Heydeck 
KUP4K   MPC855
KUP4X   MPC859
 
-Ilko Iliev 
-
-   PM9261  AT91SAM9261
-   PM9263  AT91SAM9263
-   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
-
 Gary Jennejohn 
 
quad100hd   PPC405EP
@@ -688,6 +682,12 @@ Grazvydas Ignotas 
 
omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
 
+Ilko Iliev 
+
+   PM9261  AT91SAM9261
+   PM9263  AT91SAM9263
+   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
+
 Michael Jones 
 
omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
-- 
1.7.11.3

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


[U-Boot] [PATCH v2 7/9] arm720t: add linkage macro for relocate_code

2012-08-01 Thread Allen Martin
The linker needs this to understand that the symbol is actually a
function so it will generate correct thumb interworking code.

Signed-off-by: Allen Martin 
---
 arch/arm/cpu/arm720t/start.S |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 73b57c0..11e9194 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  *
@@ -165,8 +166,7 @@ call_board_init_f:
  * after relocating the monitor code.
  *
  */
-   .globl  relocate_code
-relocate_code:
+ENTRY(relocate_code)
mov r4, r0  /* save addr_sp */
mov r5, r1  /* save addr of gd */
mov r6, r2  /* save addr of destination */
@@ -273,6 +273,7 @@ _rel_dyn_end_ofs:
.word __rel_dyn_end - _start
 _dynsym_start_ofs:
.word __dynsym_start - _start
+ENDPROC(relocate_code)
 
 /*
  *
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 8/9] arm: use thumb interworking returns in libgcc

2012-08-01 Thread Allen Martin
If CONFIG_SYS_THUMB_BUILD is enabled, use thumb interworking return
instructions from libgcc routines, otherwise use ARM returns.

Signed-off-by: Allen Martin 
---
 arch/arm/include/asm/assembler.h |   10 ++
 arch/arm/lib/_ashldi3.S  |3 ++-
 arch/arm/lib/_ashrdi3.S  |3 ++-
 arch/arm/lib/_divsi3.S   |   15 +++
 arch/arm/lib/_lshrdi3.S  |3 ++-
 arch/arm/lib/_modsi3.S   |9 -
 arch/arm/lib/_udivsi3.S  |8 +---
 arch/arm/lib/_umodsi3.S  |   18 +-
 arch/arm/lib/memcpy.S|   10 ++
 arch/arm/lib/memset.S|3 ++-
 10 files changed, 69 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 5e4789b..25ece01 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -13,6 +13,7 @@
  *  Do not include any C declarations in this file - it is included by
  *  assembler source.
  */
+#include 
 
 /*
  * Endian independent macros for shifting bytes within registers.
@@ -58,3 +59,12 @@
  * Cache alligned
  */
 #define CALGN(code...) code
+
+/*
+ * return instruction
+ */
+#ifdef CONFIG_SYS_THUMB_BUILD
+#define RETbx  lr
+#else
+#define RETmov pc, lr
+#endif
diff --git a/arch/arm/lib/_ashldi3.S b/arch/arm/lib/_ashldi3.S
index 834ddc2..e280f26 100644
--- a/arch/arm/lib/_ashldi3.S
+++ b/arch/arm/lib/_ashldi3.S
@@ -25,6 +25,7 @@ along with this program; see the file COPYING.  If not, write 
to
 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#include 
 
 #ifdef __ARMEB__
 #define al r1
@@ -45,4 +46,4 @@ __aeabi_llsl:
movpl   ah, al, lsl r3
orrmi   ah, ah, al, lsr ip
mov al, al, lsl r2
-   mov pc, lr
+   RET
diff --git a/arch/arm/lib/_ashrdi3.S b/arch/arm/lib/_ashrdi3.S
index 671ac87..3edda9f 100644
--- a/arch/arm/lib/_ashrdi3.S
+++ b/arch/arm/lib/_ashrdi3.S
@@ -25,6 +25,7 @@ along with this program; see the file COPYING.  If not, write 
to
 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#include 
 
 #ifdef __ARMEB__
 #define al r1
@@ -45,4 +46,4 @@ __aeabi_lasr:
movpl   al, ah, asr r3
orrmi   al, al, ah, lsl ip
mov ah, ah, asr r2
-   mov pc, lr
+   RET
diff --git a/arch/arm/lib/_divsi3.S b/arch/arm/lib/_divsi3.S
index cfbadb2..ab59d78 100644
--- a/arch/arm/lib/_divsi3.S
+++ b/arch/arm/lib/_divsi3.S
@@ -1,3 +1,5 @@
+#include 
+#include 
 
 .macro ARM_DIV_BODY dividend, divisor, result, curbit
 
@@ -116,27 +118,32 @@ __aeabi_idiv:
 
cmp ip, #0
rsbmi   r0, r0, #0
-   mov pc, lr
+   RET
 
 10:teq ip, r0  @ same sign ?
rsbmi   r0, r0, #0
-   mov pc, lr
+   RET
 
 11:movlo   r0, #0
moveq   r0, ip, asr #31
orreq   r0, r0, #1
-   mov pc, lr
+   RET
 
 12:ARM_DIV2_ORDER r1, r2
 
cmp ip, #0
mov r0, r3, lsr r2
rsbmi   r0, r0, #0
-   mov pc, lr
+   RET
 
 Ldiv0:
 
str lr, [sp, #-4]!
bl  __div0
mov r0, #0  @ About as wrong as it could be.
+#ifdef CONFIG_SYS_THUMB_BUILD
+   ldr lr, [sp], #4
+   bx  lr
+#else
ldr pc, [sp], #4
+#endif
diff --git a/arch/arm/lib/_lshrdi3.S b/arch/arm/lib/_lshrdi3.S
index e7fa799..4d7784d 100644
--- a/arch/arm/lib/_lshrdi3.S
+++ b/arch/arm/lib/_lshrdi3.S
@@ -25,6 +25,7 @@ along with this program; see the file COPYING.  If not, write 
to
 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#include 
 
 #ifdef __ARMEB__
 #define al r1
@@ -45,4 +46,4 @@ __aeabi_llsr:
movpl   al, ah, lsr r3
orrmi   al, al, ah, lsl ip
mov ah, ah, lsr r2
-   mov pc, lr
+   RET
diff --git a/arch/arm/lib/_modsi3.S b/arch/arm/lib/_modsi3.S
index 539c584..9c7ce8c 100644
--- a/arch/arm/lib/_modsi3.S
+++ b/arch/arm/lib/_modsi3.S
@@ -1,3 +1,5 @@
+#include 
+#include 
 
 .macro ARM_MOD_BODY dividend, divisor, order, spare
 
@@ -88,7 +90,7 @@ __modsi3:
 
 10:cmp ip, #0
rsbmi   r0, r0, #0
-   mov pc, lr
+   RET
 
 
 Ldiv0:
@@ -96,4 +98,9 @@ Ldiv0:
str lr, [sp, #-4]!
bl  __div0
mov r0, #0  @ About as wrong as it could be.
+#ifdef CONFIG_SYS_THUMB_BUILD
+   ldr lr, [sp], #4
+   bx  lr
+#else
ldr pc, [sp], #4
+#endif
diff --git a/arch/arm/lib/_udivsi3.S b/arch/arm/lib/_udivsi3.S
index 1309802..09a1664 100644
--- a/arch/arm/lib/_udivsi3.S
+++ b/arch/arm/lib/_udivsi3.S
@@ -1,3 +1,5 @@
+#include 
+
 /* # 1 "libgcc1.S" */
 @ libgcc1 routines for ARM cpu.
 @ Division routines, written by Richard Earnshaw, (rearn...@armltd.co.uk)
@@ -64,7 +66,7 @@ Loop3:
bne Loop3
 Lgot_re

[U-Boot] [PATCH v2 4/9] arm: add _thumb1_case_uqi to libgcc

2012-08-01 Thread Allen Martin
Add function required by some thumb switch statements

Signed-off-by: Allen Martin 
---
 arch/arm/lib/Makefile   |1 +
 arch/arm/lib/_thumb1_case_uqi.S |   41 +++
 2 files changed, 42 insertions(+)
 create mode 100644 arch/arm/lib/_thumb1_case_uqi.S

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index bd3b77f..a54f831 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -33,6 +33,7 @@ GLSOBJS   += _lshrdi3.o
 GLSOBJS+= _modsi3.o
 GLSOBJS+= _udivsi3.o
 GLSOBJS+= _umodsi3.o
+GLSOBJS+= _thumb1_case_uqi.o
 
 GLCOBJS+= div0.o
 
diff --git a/arch/arm/lib/_thumb1_case_uqi.S b/arch/arm/lib/_thumb1_case_uqi.S
new file mode 100644
index 000..e4bb194
--- /dev/null
+++ b/arch/arm/lib/_thumb1_case_uqi.S
@@ -0,0 +1,41 @@
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
+   Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+   .force_thumb
+   .syntax unified
+   .globl __gnu_thumb1_case_uqi
+__gnu_thumb1_case_uqi:
+   push{r1}
+   mov r1, lr
+   lsrsr1, r1, #1
+   lslsr1, r1, #1
+   ldrbr1, [r1, r0]
+   lslsr1, r1, #1
+   add lr, lr, r1
+   pop {r1}
+   bx  lr
+
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 9/9] tegra20: enable thumb build

2012-08-01 Thread Allen Martin
Signed-off-by: Allen Martin 
---
 include/configs/tegra20-common.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
index c9e8b6b..3ce0d6f 100644
--- a/include/configs/tegra20-common.h
+++ b/include/configs/tegra20-common.h
@@ -191,6 +191,7 @@
 #define CONFIG_CMD_GPIO
 #define CONFIG_CMD_ENTERRCM
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_SYS_THUMB_BUILD
 
 /* Defines for SPL */
 #define CONFIG_SPL
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 5/9] arm: use thumb compatible return in arm720t

2012-08-01 Thread Allen Martin
Convert return from relocate_code to a thumb compatible bx
instruction.

Signed-off-by: Allen Martin 
---
 arch/arm/cpu/arm720t/start.S |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 9d02709..73b57c0 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -262,7 +262,7 @@ clbss_e:
mov r0, r5  /* gd_t */
mov r1, r6  /* dest_addr */
/* jump to it ... */
-   mov pc, lr
+   bx  lr
 
 _board_init_r_ofs:
.word board_init_r - _start
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 2/9] arm: work around assembler bug

2012-08-01 Thread Allen Martin
Disable sibling call optimization based on binutils version.  This is
to work around a bug in the assember in binutils versions < 2.22.
Branches to weak symbols can be incorrectly optimized in thumb mode to
a short branch (b.n instruction) that won't reach when the symbol gets
preempted.

http://sourceware.org/bugzilla/show_bug.cgi?id=12532

Signed-off-by: Allen Martin 
---
 arch/arm/config.mk |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 3f4453a..24b9d7c 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -87,3 +87,21 @@ endif
 ifndef CONFIG_NAND_SPL
 LDFLAGS_u-boot += -pie
 endif
+
+#
+# FIXME: binutils versions < 2.22 have a bug in the assembler where
+# branches to weak symbols can be incorrectly optimized in thumb mode
+# to a short branch (b.n instruction) that won't reach when the symbol
+# gets preempted
+#
+# http://sourceware.org/bugzilla/show_bug.cgi?id=12532
+#
+ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
+ifeq ($(GAS_BUG_12532),)
+export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \
+   then echo y; else echo n; fi)
+endif
+ifeq ($(GAS_BUG_12532),y)
+PLATFORM_RELFLAGS += -fno-optimize-sibling-calls
+endif
+endif
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 6/9] arm: change arm720t to armv4t

2012-08-01 Thread Allen Martin
arm720t is an armv4t not an armv4.  Force some tegra initialization
functions to arm mode because they contain arm only inline assembly.

Signed-off-by: Allen Martin 
---
 arch/arm/cpu/arm720t/config.mk |2 +-
 arch/arm/cpu/arm720t/tegra20/config.mk |7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
index 210c6dc..1f8aa95 100644
--- a/arch/arm/cpu/arm720t/config.mk
+++ b/arch/arm/cpu/arm720t/config.mk
@@ -24,7 +24,7 @@
 
 PLATFORM_RELFLAGS +=  -fno-common -ffixed-r8 -msoft-float
 
-PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
+PLATFORM_CPPFLAGS += -march=armv4t -mtune=arm7tdmi
 # =
 #
 # Supply options according to compiler version
diff --git a/arch/arm/cpu/arm720t/tegra20/config.mk 
b/arch/arm/cpu/arm720t/tegra20/config.mk
index 62a31d8..af63fcb 100644
--- a/arch/arm/cpu/arm720t/tegra20/config.mk
+++ b/arch/arm/cpu/arm720t/tegra20/config.mk
@@ -24,3 +24,10 @@
 # MA 02111-1307 USA
 #
 USE_PRIVATE_LIBGCC = yes
+
+#
+# THUMB1 doesn't allow mrc/mcr instructions, so need to force
+# these files to ARM mode
+#
+CFLAGS_arch/arm/cpu/tegra20-common/ap20.o += -marm
+CFLAGS_arch/arm/lib/cache-cp15.o += -marm
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 0/9] enable thumb for tegra20

2012-08-01 Thread Allen Martin
Add changes necessary to enable thumb compilation for tegra20.  This
series includes two patches to work around a bug in gas that
incorrectly optimizes short jumps in thumb mode that were posted
separately.  They can be dropped from this series when they are applied.

Allen Martin (9):
  tools, config.mk: add binutils-version
  arm: work around assembler bug
  tegra20: remove inline assembly for u32 cast
  arm: add _thumb1_case_uqi to libgcc
  arm: use thumb compatible return in arm720t
  arm: change arm720t to armv4t
  arm720t: add linkage macro for relocate_code
  arm: use thumb interworking returns in libgcc
  tegra20: enable thumb build

 arch/arm/config.mk  |   18 +
 arch/arm/cpu/arm720t/config.mk  |2 +-
 arch/arm/cpu/arm720t/start.S|7 ++---
 arch/arm/cpu/arm720t/tegra20/config.mk  |7 +
 arch/arm/cpu/tegra20-common/warmboot_avp.c  |9 +--
 arch/arm/include/asm/assembler.h|   10 +++
 arch/arm/lib/Makefile   |1 +
 arch/arm/lib/_ashldi3.S |3 ++-
 arch/arm/lib/_ashrdi3.S |3 ++-
 arch/arm/lib/_divsi3.S  |   15 ---
 arch/arm/lib/_lshrdi3.S |3 ++-
 arch/arm/lib/_modsi3.S  |9 ++-
 arch/arm/lib/{_ashrdi3.S => _thumb1_case_uqi.S} |   33 +--
 arch/arm/lib/_udivsi3.S |8 +++---
 arch/arm/lib/_umodsi3.S |   18 -
 arch/arm/lib/memcpy.S   |   10 +++
 arch/arm/lib/memset.S   |3 ++-
 config.mk   |1 +
 include/configs/tegra20-common.h|2 ++
 tools/binutils-version.sh   |   20 ++
 20 files changed, 137 insertions(+), 45 deletions(-)
 copy arch/arm/lib/{_ashrdi3.S => _thumb1_case_uqi.S} (81%)
 create mode 100755 tools/binutils-version.sh

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


[U-Boot] [PATCH v2 1/9] tools, config.mk: add binutils-version

2012-08-01 Thread Allen Martin
Modeled after gcc-version, add function to get binutils version.

Signed-off-by: Allen Martin 
---
 config.mk |1 +
 tools/binutils-version.sh |   20 
 2 files changed, 21 insertions(+)
 create mode 100755 tools/binutils-version.sh

diff --git a/config.mk b/config.mk
index 3dcea6a..919b77d 100644
--- a/config.mk
+++ b/config.mk
@@ -128,6 +128,7 @@ endif
 # cc-version
 # Usage gcc-ver := $(call cc-version)
 cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC))
+binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh $(AS))
 
 #
 # Include the make variables (CC, etc...)
diff --git a/tools/binutils-version.sh b/tools/binutils-version.sh
new file mode 100755
index 000..d4d9eb4
--- /dev/null
+++ b/tools/binutils-version.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# binutils-version [-p] gas-command
+#
+# Prints the binutils version of `gas-command' in a canonical 4-digit form
+# such as `0222' for binutils 2.22
+#
+
+gas="$*"
+
+if [ ${#gas} -eq 0 ]; then
+   echo "Error: No assembler specified."
+   printf "Usage:\n\t$0 \n"
+   exit 1
+fi
+
+MAJOR=$($gas --version | head -1 | awk '{print $NF}' | cut -d . -f 1)
+MINOR=$($gas --version | head -1 | awk '{print $NF}' | cut -d . -f 2)
+
+printf "%02d%02d\\n" $MAJOR $MINOR
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 3/9] tegra20: remove inline assembly for u32 cast

2012-08-01 Thread Allen Martin
This inline assembly just converts a function address to a u32.
Replace it with equivalent C code since the assembly was not thumb
compatible.

Signed-off-by: Allen Martin 
---
 arch/arm/cpu/tegra20-common/warmboot_avp.c |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/cpu/tegra20-common/warmboot_avp.c 
b/arch/arm/cpu/tegra20-common/warmboot_avp.c
index cd01908..0a7f09f 100644
--- a/arch/arm/cpu/tegra20-common/warmboot_avp.c
+++ b/arch/arm/cpu/tegra20-common/warmboot_avp.c
@@ -51,14 +51,7 @@ void wb_start(void)
/* enable JTAG & TBE */
writel(CONFIG_CTL_TBE | CONFIG_CTL_JTAG, &pmt->pmt_cfg_ctl);
 
-   /* Are we running where we're supposed to be? */
-   asm volatile (
-   "adr%0, wb_start;"  /* reg: wb_start address */
-   : "=r"(reg) /* output */
-   /* no input, no clobber list */
-   );
-
-   if (reg != AP20_WB_RUN_ADDRESS)
+   if ((u32)wb_start != AP20_WB_RUN_ADDRESS)
goto do_reset;
 
/* Are we running with AVP? */
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-01 Thread Andreas Bießmann
Hi Markus,

On 01.08.12 21:28, Markus Hubig wrote:
> Hello Andreas,
> 
> thanks for your responce. I will provide an updated patch based on
> your comments!
> 
> On Wed, Aug 01, 2012 at 11:58:22AM +0200, Andreas Bießmann wrote:
>> ---8<---
>> andreas@andreas-mbp % ./tools/checkpatch.pl
>> U-Boot-at91-Add-support-for-taskit-AT91SAM9G20-boards..patch
>> WARNING: Whitespace before semicolon
>> #214: FILE: board/taskit/stamp9g20/stamp9g20.c:123:
>> +;
>>
>> total: 0 errors, 1 warnings, 484 lines checked
>>
>> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX
>> MULTISTATEMENT_MACRO_USE_DO_WHILE
>>
>> U-Boot-at91-Add-support-for-taskit-AT91SAM9G20-boards..patch has style
>> problems, please review.
>>
>> If any of these errors are false positives, please report
>> them to the maintainer, see CHECKPATCH in MAINTAINERS.
>> --->8---
>>
>> I know this part is copied from other at91 boards but I wonder how we
>> should handle these while-loops without content.
> 
> Oh I didn't recognice there is a version of checkpatch provided with
> u-boot. I used the one from kernel.org which didn't put a warning out
> for this one ...
> 
>> On 30.07.12 20:01, Markus Hubig wrote:
>>> This adds support for the AT91SAM9G20 boards by taskit GmbH.
>>> Both boards, Stamp9G20 and PortuxG20, are integrated in one
>>> file. PortuxG20 is basically a SBC built around the Stamp9G20.
>>>
>>> Signed-off-by: Markus Hubig 
>>> Cc: Andreas Bießmann 
>>> ---
>>>  board/taskit/stamp9g20/Makefile|   52 
>>>  board/taskit/stamp9g20/stamp9g20.c |  199 +++
>>>  boards.cfg |2 +
>>>  include/configs/stamp9g20.h|  225 
>>> 
>>
>> MAINTAINER entry is missing
> 
> Fixed!
> 
>>> +#ifdef CONFIG_MACB
>>> +static void stamp9G20_macb_hw_init(void)
>>> +{
>>> +   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
>>> +   struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
>>> +   struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
>>> +   unsigned long erstl;
>>> +
>>> +   /* Enable MACB Chip, this is the enable PIN on Stamp Adaptor*/
>> This comment is a bit misleading. Isn't MACB the SoC MAC component? Why
>> should we switch an external element to enable an internal part? Can you
>> please rewrite the comment to be more precise?
> 
> Hmm yes you're right. That pin enables the PHY Chip which of course is
> an external component ...
> 
>>> +   at91_set_gpio_output(AT91_PIN_PA26, 0);
>>> +
>>> +   /* Enable EMAC clock */
>>> +   writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
>>
>> Is it possible to move this 'enable clock' into at91_macb_hw_init()?
>> Does your PHY address setting still work then?
>> If yes, can you please send a separate patch first adding the 'enable
>> clock' into the correct at91_macb_hw_init()?
> 
> Yes it works. I put it into arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
> and will send a separate patch.
> 
>>> +   /* Need to reset PHY -> 500ms reset */
>>> +   writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
>>> +   AT91_RSTC_MR_URSTEN, &rstc->mr);
>>
>> Hmm ... is it OK to generate the user reset here? I know this is the
>> same in at least at91sam9263ek, can you please check if we should
>> instead delete that bit in MR?
> 
> MR? Sorry I don't get this one. Please explain a bit ...

I talked about URSTEN bit in RSTC_MR (Reset Controller Mode Register;
p99 in at91sam9g20 datasheet). The URSTEN bit set to 1 means disable low
level detection on NRST pin. Which in fact disables external reset with
the reset key. One have to check if this is true or maybe I'm wrong here.

>>> +
>>> +   writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
>>> +
>>> +   /* Wait for end hardware reset */
>>> +   while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
>>> +   ;
>>
>> Endless loop if bit is not toggling, can you please add some watchdog
>> reset (if you still use wdt in your board) and some timeout?
>> This will also solve the warning detected by checkpatch.
> 
> Maybe something like this?
> 

> | /* Wait for end of hardware reset */
> | while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
> | {
> | /* avoid shutdown by watchdog */
> | hw_watchdog_reset();

WATCHDOG_RESET();

> | 
> | mdelay(10);
> | timeout--;
> | 
> | /* timeout for not getting stuck in an endless loop */
> | if (timeout <= 0) {
> | debug("ERROR: Timeout waiting for PHY reset!\n");

Error messages should not use debug macro.

> | break;
> | };
> | };

For timeout stuff you could also use get_timer(0) to get current
timestamp and compare against another timestamp.



> 
> PS.: I will send a new patch with all your requested changes already
> included, not a couple of small ones based in this one? Right!?

Yes, just a new version (v2), it is still arrived, will have a look then.

Best regards

Andreas Bießmann
__

[U-Boot] [PATCHv2] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-01 Thread Markus Hubig
This adds support for the AT91SAM9G20 boards by taskit GmbH.
Both boards, Stamp9G20 and PortuxG20, are integrated in one
file. PortuxG20 is basically a SBC built around the Stamp9G20.

Signed-off-by: Markus Hubig 
Cc: Andreas Bießmann 
---
 MAINTAINERS|4 +
 board/taskit/stamp9g20/Makefile|   52 +
 board/taskit/stamp9g20/stamp9g20.c |  185 ++
 boards.cfg |2 +
 include/configs/stamp9g20.h|  216 
 5 files changed, 459 insertions(+), 0 deletions(-)
 create mode 100644 board/taskit/stamp9g20/Makefile
 create mode 100644 board/taskit/stamp9g20/stamp9g20.c
 create mode 100644 include/configs/stamp9g20.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 84413de..649436d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -243,6 +243,10 @@ Klaus Heydeck 
KUP4K   MPC855
KUP4X   MPC859
 
+Markus Hubig 
+
+   STAMP9G20   ARM926EJS
+
 Ilko Iliev 
 
PM9261  AT91SAM9261
diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
new file mode 100644
index 000..e99bfaa
--- /dev/null
+++ b/board/taskit/stamp9g20/Makefile
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop 
+# Lead Tech Design 
+#
+# (C) Copyright 2012
+# Markus Hubig 
+# IMKO GmbH 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= stamp9g20.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/taskit/stamp9g20/stamp9g20.c 
b/board/taskit/stamp9g20/stamp9g20.c
new file mode 100644
index 000..afb9449
--- /dev/null
+++ b/board/taskit/stamp9g20/stamp9g20.c
@@ -0,0 +1,185 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop 
+ * Lead Tech Design 
+ *
+ * Achim Ehrlich 
+ * taskit GmbH 
+ *
+ * (C) Copyright 2012-
+ * Markus Hubig 
+ * IMKO GmbH 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void stamp9G20_nand_hw_init(void)
+{
+   struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
+   struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+   unsigned long csa;
+
+   /* Assign CS3 to NAND/SmartMedia Interface */
+   csa = readl(&matrix->ebicsa);
+   csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA;
+   writel(csa, &matrix->ebicsa);
+
+   /* Configure SMC CS3 for NAND/SmartMedia */
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   &smc->cs[3].setup);
+   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+   &smc->cs[3].pulse);
+   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYC

[U-Boot] [PATCH] Enable the EMAC clock in at91_macb_hw_init().

2012-08-01 Thread Markus Hubig
Signed-off-by: Markus Hubig 
Cc: Andreas Bießmann 
---
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c 
b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
index 62f76fa..19ec615 100644
--- a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
+++ b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
@@ -158,6 +158,10 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 #ifdef CONFIG_MACB
 void at91_macb_hw_init(void)
 {
+   /* Enable EMAC clock */
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
+
at91_set_a_periph(AT91_PIO_PORTA, 19, 0);   /* ETXCK_EREFCK */
at91_set_a_periph(AT91_PIO_PORTA, 17, 0);   /* ERXDV */
at91_set_a_periph(AT91_PIO_PORTA, 14, 0);   /* ERX0 */
-- 
1.7.7

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


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-01 Thread Markus Hubig
Hello Andreas,

thanks for your responce. I will provide an updated patch based on
your comments!

On Wed, Aug 01, 2012 at 11:58:22AM +0200, Andreas Bießmann wrote:
> ---8<---
> andreas@andreas-mbp % ./tools/checkpatch.pl
> U-Boot-at91-Add-support-for-taskit-AT91SAM9G20-boards..patch
> WARNING: Whitespace before semicolon
> #214: FILE: board/taskit/stamp9g20/stamp9g20.c:123:
> + ;
> 
> total: 0 errors, 1 warnings, 484 lines checked
> 
> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX
> MULTISTATEMENT_MACRO_USE_DO_WHILE
> 
> U-Boot-at91-Add-support-for-taskit-AT91SAM9G20-boards..patch has style
> problems, please review.
> 
> If any of these errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
> --->8---
> 
> I know this part is copied from other at91 boards but I wonder how we
> should handle these while-loops without content.

Oh I didn't recognice there is a version of checkpatch provided with
u-boot. I used the one from kernel.org which didn't put a warning out
for this one ...

> On 30.07.12 20:01, Markus Hubig wrote:
> > This adds support for the AT91SAM9G20 boards by taskit GmbH.
> > Both boards, Stamp9G20 and PortuxG20, are integrated in one
> > file. PortuxG20 is basically a SBC built around the Stamp9G20.
> > 
> > Signed-off-by: Markus Hubig 
> > Cc: Andreas Bießmann 
> > ---
> >  board/taskit/stamp9g20/Makefile|   52 
> >  board/taskit/stamp9g20/stamp9g20.c |  199 +++
> >  boards.cfg |2 +
> >  include/configs/stamp9g20.h|  225 
> > 
> 
> MAINTAINER entry is missing

Fixed!

> > +#ifdef CONFIG_MACB
> > +static void stamp9G20_macb_hw_init(void)
> > +{
> > +   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> > +   struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
> > +   struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
> > +   unsigned long erstl;
> > +
> > +   /* Enable MACB Chip, this is the enable PIN on Stamp Adaptor*/
> This comment is a bit misleading. Isn't MACB the SoC MAC component? Why
> should we switch an external element to enable an internal part? Can you
> please rewrite the comment to be more precise?

Hmm yes you're right. That pin enables the PHY Chip which of course is
an external component ...

> > +   at91_set_gpio_output(AT91_PIN_PA26, 0);
> > +
> > +   /* Enable EMAC clock */
> > +   writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
> 
> Is it possible to move this 'enable clock' into at91_macb_hw_init()?
> Does your PHY address setting still work then?
> If yes, can you please send a separate patch first adding the 'enable
> clock' into the correct at91_macb_hw_init()?

Yes it works. I put it into arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
and will send a separate patch.

> > +   /* Need to reset PHY -> 500ms reset */
> > +   writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
> > +   AT91_RSTC_MR_URSTEN, &rstc->mr);
> 
> Hmm ... is it OK to generate the user reset here? I know this is the
> same in at least at91sam9263ek, can you please check if we should
> instead delete that bit in MR?

MR? Sorry I don't get this one. Please explain a bit ...

> > +
> > +   writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
> > +
> > +   /* Wait for end hardware reset */
> > +   while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
> > +   ;
> 
> Endless loop if bit is not toggling, can you please add some watchdog
> reset (if you still use wdt in your board) and some timeout?
> This will also solve the warning detected by checkpatch.

Maybe something like this?

| /* Wait for end of hardware reset */
| while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
| {
|   /* avoid shutdown by watchdog */
|   hw_watchdog_reset();
|   
|   mdelay(10);
|   timeout--;
|   
|   /* timeout for not getting stuck in an endless loop */
|   if (timeout <= 0) {
|   debug("ERROR: Timeout waiting for PHY reset!\n");
|   break;
|   };
| };

> > +int board_early_init_f(void)
> > +{
> > +   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> > +
> > +   /* Enable clocks for all PIOs */
> > +   writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
> > +   (1 << ATMEL_ID_PIOC), &pmc->pcer);
> 
> you should initialize seriald_hw here to avoid strange characters on
> serial line when switching from at91bootstrap to u-boot.

If I do so I don't get serial output any more ;-(

> > +#ifdef CONFIG_PORTUXG20
> > +   gd->bd->bi_arch_number = MACH_TYPE_PORTUXG20;
> > +#else
> > +   gd->bd->bi_arch_number = MACH_TYPE_STAMP9G20;
> > +#endif
> 
> I would favor the generic CONFIG_MACH_TYPE here -> see
> arch/arm/lib/board.c:401
> Just add the definition in your board config header and remove these
> lines here.

Fixed!

> > +   /* adress of boot parameters */
> > +   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
> > +
> 

Re: [U-Boot] [PATCH] SPI: Remove superfluous semicolon

2012-08-01 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <201208011226.04685.vap...@gentoo.org> you wrote:
>
> i've added it to my branch, but if Wolfgang merges it directly, that's fine 
> too

I'm happy if you take it.  Thanks.

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
Chapter 1 -- The story so  far:
In the beginning the Universe was created. This has  made  a  lot  of
people very angry and been widely regarded as a bad move.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] early_malloc outline

2012-08-01 Thread Wolfgang Denk
Dear Tomas,

In message  
you wrote:
> 
> > It is difficult (or actually impossible) to answer this, if you do not
> > explain which concept you are talking about here, or why two copy
> > operations would be needed, what "in case of DM" means (and which
> > other cases exist), or how you intend to handle the problem of
> > changing addresses (and thus pointers becoming incorrect) for each of
> > such copy operations.
...
> Other guys working on DM wants AFAIK to create DM tree using
> early_malloc inside board_init_f(). The tree is going to have root and
> on some boards few extra elements, like 2 or 3 in this phase and each
> object has 16 bytes. Then they want to have this tree accessible (or
> at least a copy of the tree) in board_init_r(). They want to traverse
> the tree (by recomputing pointers) at some point in board_init_r(),
> allocate new tree objects using dlmalloc and copy the data into the
> new tree.

Hm... I have to admit that I am not really happy about such an
"explanation".  The statement that "other guys" want something is not
exactly an explanation of a concept that I can understand, and without
being able to understand it, I don't buy it.

Please do not assume that everybody has followed all (or any) or your
previous discussions on the DM list.  Please assume I have zero prior
knowledge about that stuff (which is about correct), and explain what
the concept is.  And please keep in mind that any time you write
"I/they want", I will wonder "why?", and probably we lose time in
another iteration because I will actually ask this question.

> The concept I am thinking about is reserving space for early heap
> right after GD by same platform specific means (i.e. subtracting
> CONFIG_SYS_INIT_SP_ADDR). Then I would like to reserve space in RAM

You are mixing design and implementation here.  Where exactly this
storage space is located, and how youcreate it etc., is implementation
details.  We should ignore this here.

> equal to used size of early_heap before relocation and memcpy the
> existing early_heap there (the same way GD are copied). Therefore we
> would have a copy of used early_heap in RAM and we can recompute
> pointers to traverse the tree in board_init_r().

But why would 2 copies be needed?  I understand then once regular
malloc() becomes available, you want to make sure all allocations are
maintained using this mechanism.  But I already wonder how you are
going to implement this - you will have to update all pointers.  How
will you find out where these might be?

Assume something like:

item *foo(...)
{
static item *foo_local = malloc(size1);
...
return foo_local;
}

item *bar(..., item **ptr)
{
static item *bar_local = malloc(size2);
...
*ptr = bar_local;
return bar_local;
}

void some_function(...)
{
item *x, *y;
...
x = bar(..., &y);
baz(y);
...
}

How will you later know which variables store the values from the early
malloc calls, and how will you access these for proper relocation?

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
What is mind?  No matter.  What is matter?  Never mind.
  -- Thomas Hewitt Key, 1799-1875
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/7] dfu:cmd: Support for DFU u-boot command

2012-08-01 Thread Mike Frysinger
On Tuesday 31 July 2012 02:37:01 Lukasz Majewski wrote:
> --- /dev/null
> +++ b/common/cmd_dfu.c
>
> + static char *s = "dfu";

no need for this to be static
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-BOOT]: Add support for numonyx spi flash.

2012-08-01 Thread Mike Frysinger
On Wednesday 25 July 2012 11:57:58 jagan wrote:
> We have a numonyx spi flash (N25Q128) on my target.

Stephan Linz posted some patches recently to make this work
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] sf: stmicro: add support N25Q128 parts

2012-08-01 Thread Mike Frysinger
On Friday 13 July 2012 14:07:19 Stephan Linz wrote:
> Adds support for Numonyx's N25Q128 SPI flash. These devices
> are used on (among others) Avnet Spartan-6 LX9 micro-evaluation
> boards. Tested with "sf" commands and CONFIG_ENV_IS_IN_SPI_FLASH.

needs to be rebased onto mainline.  looks fine otherwise.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] sf: stmicro: support JEDEC standard two-byte signature

2012-08-01 Thread Mike Frysinger
On Friday 13 July 2012 14:07:18 Stephan Linz wrote:
> There are more than the M25Pxx serial flashs that can be
> used with the stmicro driver, for example: the M25PXxx or
> N25Qxx serie. All these chips have burned in the original
> stmicro manufacture id 0x20 together with a standard
> two-byte signature.

can you rebase onto mainline and re-post ?

> --- a/drivers/mtd/spi/stmicro.c
> +++ b/drivers/mtd/spi/stmicro.c
> 
>   for (i = 0; i < ARRAY_SIZE(stmicro_spi_flash_table); i++) {
>   params = &stmicro_spi_flash_table[i];
> - if (params->idcode1 == idcode[2]) {
> + if (params->id == ((idcode[1] << 8) | idcode[2]))
>   break;
> - }
>   }

can you add a local u16 variable and store the computation of the idcode here 
to that above the for loop ?

>   if (i == ARRAY_SIZE(stmicro_spi_flash_table)) {
> - debug("SF: Unsupported STMicro ID %02x\n", idcode[1]);
> + debug("SF: Unsupported STMicro ID %02x%02x\n",
> + idcode[1], idcode[2]);

then here you can simply change:
%02x -> %04x
idcode[1] -> 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/2] arm: work around assembler bug

2012-08-01 Thread Allen Martin
On Thu, Jul 19, 2012 at 08:08:31AM -0700, Tom Rini wrote:
> On 07/18/2012 11:06 PM, Albert ARIBAUD wrote:
> > Hi Allen,
> > 
> > On Wed, 18 Jul 2012 16:45:53 -0700, Allen Martin  wrote:
> >> Disable sibling call optimization based on binutils version.  This is
> >> to work around a bug in the assember in binutils versions < 2.22.
> >> Branches to weak symbols can be incorrectly optimized in thumb mode to
> >> a short branch (b.n instruction) that won't reach when the symbol gets
> >> preempted.
> >>
> >> http://sourceware.org/bugzilla/show_bug.cgi?id=12532
> >>
> >> Signed-off-by: Allen Martin 


> > Can previous reviewers ack or test this? I would like to have it in the ARM
> > master branch in time for 12.07.
> 
> Acked-by: Tom Rini 

Hi Albert, just checking on the status of applying this to
u-boot-arm.  I have a patch series to enable thumb for tegra that
needs this.  I'll probably just keep a copy of this in that series
until it goes in.

thanks,
-Allen

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


Re: [U-Boot] [PATCH v3 5/7] dfu:cmd: Support for DFU u-boot command

2012-08-01 Thread Stephen Warren
On 08/01/2012 01:16 AM, Lukasz Majewski wrote:
> Hi Stephen Warren,
> 
>> On 07/31/2012 12:37 AM, Lukasz Majewski wrote:
>>> Support for u-boot's "dfu   [list]" command.
>>
>>> +U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
>>> +   "Device Firmware Upgrade",
>>> +   "  [list]\n"
>>> +   "  - device firmware upgrade on a device \n"
>>> +   "attached to interface \n"
>>> +   "[list] - list available alt settings"
>>> +);
...
>> Somewhat related to this, it looks like the eMMC support doesn't allow
>> the HW partition to be specified; it would be nice to expose alt
>> settings for all of:
>>
>> a) Each individual HW partition (boot0/1 if present, general0/1/2/3 if
>> present, the user area, maybe the replay block)
> 
> I'm fully aware of this problem.
> In the eMMC case, the access to boot partitions will be served by
> defining special alt settings for DFU.
> 
> Those altsettings will be defined as follows:
> -a[N] boot0
> -a[N+1] boot1
> 
> Prerequisite for this functionality is support of "boot"
> command, which will allow switching of the MMC available address spaces
> (e.g. between boot0/boot1 and user accessible space).

Is this "boot" command a DFU protocol command, or a U-Boot command-line
command? I note that the U-Boot command-line already allows HW partition
selection using an additional parameter to "mmc" - "mmc dev
$mmc_device_id $partition_id".

>> b) Perhaps also a linearized view of the raw eMMC (LBAs 0..boot_size-1
>> write to boot 0, LBAs boot_size..(2*boot_size)-1 write to boot1, LBAs
>> 2*boot_size..end_of_device write to user area for example).
> 
> Access to partitions will be done differently. I assume that each eMMC
> memory (the user accessible part) will be equipped with MBR or GPT
> definition.

That's a different kind of partition though.

In general, there's no need for the eMMC device to contain any kind of
standardized SW-level partition table. On Tegra, the boot ROM can boot
directly from an eMMC device, and that requires raw data in the
partitions, not a standardized SW partition table.

> For this reason I'm now developing the USB Mass Storage (UMS) gadget to
> export eMMC to host PC.
> This solves the problem with accessing separate partitions. 

OK, if the raw eMMC device is exposed using USB storage, we should be
able to dd directly to it and the presence-or-lack-thereof of any
MBR/GPT wouldn't even be relevant.

It'd still be useful to have a linearized view of the flash that
concatenated all the HW partitions into a single raw device, but I guess
an alt setting for that probably could be added later.

> Please also be aware, that DFU shall be used only for relatively small
> files (due to small EP0 bandwidth).
> 
> Large files shall be copied with UMS.

Oh, didn't know that. Just out of curiosity, are you thinking of
implementing that too?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Problem with PCIexpress switch

2012-08-01 Thread Miguel Ángel Álvarez
Dear all,

We are developing a board using a Freescale P2020. This micro has
three PCIexpress ports. 2 1xlane PCIe and 1 2xlane PCIe.

We have been able to successfully use the PCIe interfaces.

However, now we want to expand the number of PCIe slots connecting the
2xlane PCIe to a PCIe switch (89HPES6T5E). This switch offers a 2xlane
upstream port and 4 1xlane downstream ports.

The problem is that we do not really know how PCIe switches are
managed in Linux. If any of you can recommend us some resources to
read, we will appreciate it very much.

If there is no information to read, let me describe our main problem.

The question is that if I let u-boot scan the PCIe, the upstream and
downstream ports are detected as well as the cards connected to the
downstream port. However when u-boot launches Linux, this last just
finds a device (the HPES6T5E), and none of the downstream ports or
card connected to them.

pci :00:00.0: PCI bridge, secondary bus :01
pci :00:00.0:   IO window: 0x00-0x
pci :00:00.0:   MEM window: 0x8000-0x9fff
pci :00:00.0:   PREFETCH window: disabled
pci :00:00.0: enabling device (0106 -> 0107)
pci 0001:02:00.0: PCI bridge, secondary bus 0001:03
pci 0001:02:00.0:   IO window: 0x00-0x
pci 0001:02:00.0:   MEM window: 0xa000-0xbfff
pci 0001:02:00.0:   PREFETCH window: disabled
pci 0001:02:00.0: enabling device (0106 -> 0107)
pci 0002:05:00.0: PCI bridge, secondary bus 0002:06
pci 0002:05:00.0:   IO window: disabled
pci 0002:05:00.0:   MEM window: 0xc000-0xc00f
pci 0002:05:00.0:   PREFETCH window: disabled
pci 0002:04:00.0: PCI bridge, secondary bus 0002:05
pci 0002:04:00.0:   IO window: 0x00-0x
pci 0002:04:00.0:   MEM window: 0xc000-0xdfff
pci 0002:04:00.0:   PREFETCH window: disabled
pci 0002:04:00.0: enabling device (0106 -> 0107)

However, if I do not let u-boot scan the bus (undef CONFIG_PCI_PNP,
for example), Linux finds five devices
for the 89HPES6T5E and the card connected to the downstream ports.

pci :00:00.0: PCI bridge, secondary bus :01
pci :00:00.0:   IO window: 0x00-0x
pci :00:00.0:   MEM window: 0x8000-0x9fff
pci :00:00.0:   PREFETCH window: disabled
pci :00:00.0: enabling device (0106 -> 0107)
pci 0001:02:00.0: PCI bridge, secondary bus 0001:03
pci 0001:02:00.0:   IO window: 0x00-0x
pci 0001:02:00.0:   MEM window: 0xa000-0xbfff
pci 0001:02:00.0:   PREFETCH window: disabled
pci 0001:02:00.0: enabling device (0106 -> 0107)
pci 0002:06:02.0: PCI bridge, secondary bus 0002:07
pci 0002:06:02.0:   IO window: disabled
pci 0002:06:02.0:   MEM window: disabled
pci 0002:06:02.0:   PREFETCH window: disabled
pci 0002:06:03.0: PCI bridge, secondary bus 0002:08
pci 0002:06:03.0:   IO window: disabled
pci 0002:06:03.0:   MEM window: disabled
pci 0002:06:03.0:   PREFETCH window: disabled
pci 0002:06:04.0: PCI bridge, secondary bus 0002:09
pci 0002:06:04.0:   IO window: disabled
pci 0002:06:04.0:   MEM window: disabled
pci 0002:06:04.0:   PREFETCH window: disabled
pci 0002:06:05.0: PCI bridge, secondary bus 0002:0a
pci 0002:06:05.0:   IO window: disabled
pci 0002:06:05.0:   MEM window: 0xc000-0xc00f
pci 0002:06:05.0:   PREFETCH window: disabled
pci 0002:05:00.0: PCI bridge, secondary bus 0002:06
pci 0002:05:00.0:   IO window: disabled
pci 0002:05:00.0:   MEM window: 0xc000-0xc00f
pci 0002:05:00.0:   PREFETCH window: disabled
pci 0002:04:00.0: PCI bridge, secondary bus 0002:05
pci 0002:04:00.0:   IO window: 0x00-0x
pci 0002:04:00.0:   MEM window: 0xc000-0xdfff
pci 0002:04:00.0:   PREFETCH window: disabled
pci 0002:04:00.0: enabling device (0106 -> 0107)
pci 0002:05:00.0: enabling device ( -> 0002)
pci 0002:06:05.0: enabling device ( -> 0002)

/sys/bus/pci/devices # ls
0002:0a:00.0  0002:06:04.0  0002:06:02.0  0002:04:00.0  :00:00.0
0002:06:05.0  0002:06:03.0  0002:05:00.0  0001:02:00.0

It seems that the problem comes from the detection of a
PCI_CLASS_BRIDGE_PCI device in pciauto_config_device, but I do not
understand the rest of the problem.

Any clues?

Thanks

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


Re: [U-Boot] [PATCH] net: Improve the speed of netconsole

2012-08-01 Thread Joe Hershberger
Hi Mike,

On Wed, Aug 1, 2012 at 11:35 AM, Mike Frysinger  wrote:
> On Monday 30 July 2012 17:08:41 Joe Hershberger wrote:
>> On Wed, Jul 25, 2012 at 1:49 PM, Mike Frysinger wrote:
>> > On Tuesday 24 July 2012 16:11:15 Joe Hershberger wrote:
>> >> --- a/net/eth.c
>> >> +++ b/net/eth.c
>> >>
>> >> +#ifdef CONFIG_NETCONSOLE_PERSIST_ETH
>> >> +int eth_init_state_only(bd_t *bis)
>> >> +{
>> >> + eth_current->state = ETH_STATE_ACTIVE;
>> >> +
>> >> + return 0;
>> >> +}
>> >> +
>> >> +void eth_halt_state_only(void)
>> >> +{
>> >> + eth_current->state = ETH_STATE_PASSIVE;
>> >> +}
>> >> +#endif
>> >
>> > these *really* should be static inlines in the global header.  they're so
>> > dirt simple, the overhead of the function call is probably much higher
>> > than the single memory store.
>>
>> I can do that, but I don't think it will save anything.  Since
>> eth_current is static, I would have to change it to eth_get_dev(), and
>> we're back to a function call.  Thoughts?
>
> i wonder why eth_get_dev is an external func then :)

An attempt at encapsulation I assume.  I guess I could just make it global.

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


Re: [U-Boot] [PATCH] net: Improve the speed of netconsole

2012-08-01 Thread Mike Frysinger
On Monday 30 July 2012 17:08:41 Joe Hershberger wrote:
> On Wed, Jul 25, 2012 at 1:49 PM, Mike Frysinger wrote:
> > On Tuesday 24 July 2012 16:11:15 Joe Hershberger wrote:
> >> --- a/net/eth.c
> >> +++ b/net/eth.c
> >> 
> >> +#ifdef CONFIG_NETCONSOLE_PERSIST_ETH
> >> +int eth_init_state_only(bd_t *bis)
> >> +{
> >> + eth_current->state = ETH_STATE_ACTIVE;
> >> +
> >> + return 0;
> >> +}
> >> +
> >> +void eth_halt_state_only(void)
> >> +{
> >> + eth_current->state = ETH_STATE_PASSIVE;
> >> +}
> >> +#endif
> > 
> > these *really* should be static inlines in the global header.  they're so
> > dirt simple, the overhead of the function call is probably much higher
> > than the single memory store.
> 
> I can do that, but I don't think it will save anything.  Since
> eth_current is static, I would have to change it to eth_get_dev(), and
> we're back to a function call.  Thoughts?

i wonder why eth_get_dev is an external func then :)
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] net: Make netconsole src and dest ports configurable

2012-08-01 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] net: Make the netconsole buffer size configurable

2012-08-01 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7 V3] Enable SPI booting.

2012-08-01 Thread Mike Frysinger
On Wednesday 01 August 2012 05:33:32 Rajeshwari Shinde wrote:
> This patch enables SPI Booting for EXYNOS5

patch subject needs a qualifier like "EXYNOS:" since this is board/arch specific
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/7 V3] SPI: Add SPI Driver for EXYNOS.

2012-08-01 Thread Mike Frysinger
On Wednesday 01 August 2012 05:33:30 Rajeshwari Shinde wrote:
> --- /dev/null
> +++ b/drivers/spi/exynos_spi.c
>
> +DECLARE_GLOBAL_DATA_PTR;

i don't think you use this, so delete

> +void spi_flush_fifo(struct spi_slave *slave)

static

> +void spi_init(void)
> +{
> ...
> + for (i = 0; i < EXYNOS5_SPI_NUM_CONTROLLERS; i++) {
> ...
> + bus_count++;

why bother with a static bus_count ?  just use the existing define.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/7 V3] SPI: Add W25Q32 to Winbond SPI flash table

2012-08-01 Thread Mike Frysinger
On Wednesday 01 August 2012 05:33:27 Rajeshwari Shinde wrote:
> SMDK EVT1  has a different Winbond part, added its part details
> to the SPI flash table

you'll need to rebase this now onto current mainline
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] SPI: Remove superfluous semicolon

2012-08-01 Thread Mike Frysinger
Acked-by: Mike Frysinger 

i've added it to my branch, but if Wolfgang merges it directly, that's fine too
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 00/13] Basic Raspberyr Pi support

2012-08-01 Thread Tom Rini
On Tue, Jul 31, 2012 at 10:13:30PM -0600, Stephen Warren wrote:
> This series adds basic support for the Raspberry Pi ARM board.
> 
> v2:
> * Add README config_cmd_default.h documentation fix.
> * Use <> not "" for include of config_cmd_default.h.
> * Squash together 3 patches related to enabling booting a Linux kernel.
> * Minor rpi_b.h order changes in order to drop later cleanup patch.
> * Merged together 2 patch series of mine, and the GPIO series from Vikram.
> 
> Stephen Warren (11):
>   README: fix references to config_cmd_default.h
>   ARM: add basic support for the Broadcom BCM2835 SoC
>   ARM: bcm2835: add Raspberry Pi model B board
>   ARM: arm1176: enable instruction cache in arch_cpu_init()
>   ARM: rpi_b: enable CONFIG_ARCH_CPU_INIT for icache
>   ARM: rpi_b: define CONFIG_MACH_TYPE
>   ARM: rpi_b: include config_cmd_default.h
>   ARM: rpi_b: enable booting the Linux kernel
>   ARM: rpi_b: drop RAM size to 128M
>   ARM: rpi_b: move stack to top of RAM
>   ARM: bcm2835: implement reset using watchdog

I think some of these should be collapsed.  Implement reset using the
watchdog in the first SoC commit.  Add a fully functional rpi_b config /
board file from the get-go (with a why we limit to 128MB DRAM) and just
credit the folks that did parts X/Y/Z in the commit message.

-- 
Tom


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


Re: [U-Boot] [PATCH V2 03/13] ARM: bcm2835: add Raspberry Pi model B board

2012-08-01 Thread Tom Rini
On Wed, Aug 01, 2012 at 09:19:15AM -0700, Tom Rini wrote:
> On Tue, Jul 31, 2012 at 10:13:33PM -0600, Stephen Warren wrote:
> > The Raspberry Pi model B uses the BCM2835 SoC, has 256MB of RAM, contains
> > an SMSC 9512 USB LAN/Hub chip, and various IO connectors. For more details,
> > see http://www.raspberrypi.org/.
> > 
> > Signed-off-by: Stephen Warren 
> [snip]
> > +int dram_init(void)
> > +{
> > +   gd->ram_size = SZ_256M;
> > +
> > +   return 0;
> > +}
> 
> You should use get_ram_size(CONFIG_SYS_SDRAM_BASE,
> max-possible-dram-size);  I say this as I just found a "oh, so that's
> why mainline reports the right amount of memory and other tree does not"
> bug yesterday.  This should also be in the SoC-generic code area (like
> say arch/arm/cpu/arm1176/bcm2835/board.c).  Sorry I didn't spot this
> last go-round.

I forgot about the video co-processor change later in the series, so you
can disregard this specific comment.  But I have some still applicable
comments I'm going to add to the 0/13 patch now.

-- 
Tom


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


Re: [U-Boot] [PATCH V2 03/13] ARM: bcm2835: add Raspberry Pi model B board

2012-08-01 Thread Tom Rini
On Tue, Jul 31, 2012 at 10:13:33PM -0600, Stephen Warren wrote:
> The Raspberry Pi model B uses the BCM2835 SoC, has 256MB of RAM, contains
> an SMSC 9512 USB LAN/Hub chip, and various IO connectors. For more details,
> see http://www.raspberrypi.org/.
> 
> Signed-off-by: Stephen Warren 
[snip]
> +int dram_init(void)
> +{
> + gd->ram_size = SZ_256M;
> +
> + return 0;
> +}

You should use get_ram_size(CONFIG_SYS_SDRAM_BASE,
max-possible-dram-size);  I say this as I just found a "oh, so that's
why mainline reports the right amount of memory and other tree does not"
bug yesterday.  This should also be in the SoC-generic code area (like
say arch/arm/cpu/arm1176/bcm2835/board.c).  Sorry I didn't spot this
last go-round.

[snip]
> +#define CONFIG_SYS_BAUDRATE_TABLE{ 9600, 19200, 38400, 57600, 115200 }

This is the table now in  which is auto-included.

> +#define CONFIG_SYS_PROMPT_HUSH_PS2   "> "

This is now the default prompt value, so you can drop this line.

-- 
Tom


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


[U-Boot] Merging the pogo_e02 and sheevaplug code

2012-08-01 Thread Karl O. Pinc
Hi,

I'm looking at possibly merging the pogo_e02 and sheevaplug code
and have some general questions before doing anything.

The pogoplug POGO-E02 (pogo_e02 target) and the sheevaplug (sheevaplug
development kit) (sheevaplug target) board are very similar.  
They are arm (Marvell) kirkwood boards.
The sheevaplug has 1G of ram the pogo_e02 has 256M.
Code-wise, the two boards have slightly different
kwbimage.cfg files.  There is something going on in the
kwmpp_config[] array, the current pogo_e02 code omits a lot
of elements of this array that are present in the sheevaplug
but are otherwise identical.  I can look into this myself
unless someone wants to hand me a clue.  Finally, there's
the board initialization: board_init(void).  The
sheevaplug has
  gd->bd->bi_arch_number = MACH_TYPE_SHEEVAPLUG;
wheras the pogo_e02 does something different
  gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;


Here are my questions:

(FYI I haven't pulled from the git repo in about 2 weeks
as I've looked about and made notes.)

Should I even try to merge this code?  Is the code reduction
worth the #ifdefs?  Is this going to confound the
official maintainers of these boards?

The sheevaplug is a Marvell board boards/Marvell/
whereas the pogo_e02 is made by cloudengines,
boards/cloudengines/.  This seems to present a
policy problem.  Should I leave a 
boards/cloudengines/README.pogo_e02 behind
after the merge or what?

I'll look at the kwmpp_config[] array content.

What is MACH_TYPE_*?  arch/arm/include/asm/mach-types.h 
says it's automatically generated from
arch/arm/tools/mach-types and to see
arch/arm/kernel/arch.c but neither of these
files exist.  Does the pogo_e02 need
a MACH_TYPE_POGO_E02?  I grepped around and the
whole point of MACH_TYPE_SHEEVAPLUG seems
to be to #define machine_is_sheevaplug()
but this does not seem to be used anywhere.

I'll look up gd->bd->bi_boot_params
but if anybody has a clue I'd be happy to
get one.

If I do this what's the best series of patches
to send?  Should I try to make the code 
as similar as possible by synchronizing the
comments and such before doing the merge
or should I just send one patch that merges
the code?

FWIW I plan a CONFIG_IDENT_STRING to
distinguish the sheevaplug from the pogo_e02 image.

Anything else I should know?

Thanks for the help.

Karl 
Free Software:  "You don't pay back, you pay forward."
 -- Robert A. Heinlein

P.S.  I have reason to believe that the 
boards/cloudengines/pogo_e02/kwbimage.cfg file
should be changed.  At least it does not conform
to what's in the factory-supplied file.
Before I send a patch I want to use the
new values in an image that I use to boot
an actual device.  I'm putting this off
until I have the final code I want to run.
Hence this message.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] early_malloc outline

2012-08-01 Thread Tomas Hlavacek
Dear Wolfgang,

On Tue, Jul 31, 2012 at 9:52 PM, Wolfgang Denk  wrote:

>> Can/should we use some existing mechanism? Or would it be considered a
>> viable option to choose different beginning address for early heap,
>> use it (in architecture-specific way) and keep the pointer to the
>> beginning in GD. Then copy the early heap to memory before caches are
>> flushed and in case of DM copy again data from early heap to new
>> destinations that has been obtained through malloc() when it is
>> initialized?
>
> It is difficult (or actually impossible) to answer this, if you do not
> explain which concept you are talking about here, or why two copy
> operations would be needed, what "in case of DM" means (and which
> other cases exist), or how you intend to handle the problem of
> changing addresses (and thus pointers becoming incorrect) for each of
> such copy operations.

I have been given an advice by Graeme not to make early_malloc() as
one-purpose thing for DM (i.e. not to implement DM tree relocation or
special support for doing so in early_malloc routines).

Other guys working on DM wants AFAIK to create DM tree using
early_malloc inside board_init_f(). The tree is going to have root and
on some boards few extra elements, like 2 or 3 in this phase and each
object has 16 bytes. Then they want to have this tree accessible (or
at least a copy of the tree) in board_init_r(). They want to traverse
the tree (by recomputing pointers) at some point in board_init_r(),
allocate new tree objects using dlmalloc and copy the data into the
new tree.

The concept I am thinking about is reserving space for early heap
right after GD by same platform specific means (i.e. subtracting
CONFIG_SYS_INIT_SP_ADDR). Then I would like to reserve space in RAM
equal to used size of early_heap before relocation and memcpy the
existing early_heap there (the same way GD are copied). Therefore we
would have a copy of used early_heap in RAM and we can recompute
pointers to traverse the tree in board_init_r().

Tomas

-- 
Tomáš Hlaváček 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Fabio Estevam
Hi Dirk,

On Wed, Aug 1, 2012 at 10:43 AM, Dirk Behme  wrote:

> Sounds like the above is incomplete, then?

I will send a kernel patch to setup these two clocks for sabrelite. I
don't have a sabrelite handy now, but if you have a chance to test it,
please let me know.

Regards,

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


[U-Boot] [V2] arm: Fixed the offset for the no relocation.

2012-08-01 Thread Zhong Hongbo
From: Zhong Hongbo 

When the u-boot address of destination equal to  __start,
no relocation. relocation offset(r9) = 0.

Signed-off-by: Zhong Hongbo 
---
Change for V2:
- Clean a line for arm1176
---
 arch/arm/cpu/arm1136/start.S   |1 +
 arch/arm/cpu/arm1176/start.S   |1 +
 arch/arm/cpu/arm720t/start.S   |1 +
 arch/arm/cpu/arm920t/start.S   |1 +
 arch/arm/cpu/arm925t/start.S   |1 +
 arch/arm/cpu/arm926ejs/start.S |1 +
 arch/arm/cpu/arm946es/start.S  |1 +
 arch/arm/cpu/arm_intcm/start.S |1 +
 arch/arm/cpu/ixp/start.S   |1 +
 arch/arm/cpu/lh7a40x/start.S   |1 +
 arch/arm/cpu/pxa/start.S   |1 +
 arch/arm/cpu/s3c44b0/start.S   |1 +
 arch/arm/cpu/sa1100/start.S|1 +
 13 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 2483c63..3752af9 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -190,6 +190,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index d613641..667a0e0 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -252,6 +252,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 3b97e80..913065b 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -167,6 +167,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 9b8604e..14c9156 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -210,6 +210,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 1a54416..3a483f6 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -204,6 +204,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 6f05f1a..1b530dc 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -235,6 +235,7 @@ stack_setup:
adr r0, _start
sub r9, r6, r0  /* r9 <- relocation offset */
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index b4d1d2d..30e2183 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -175,6 +175,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index b85e7d4..a133d19 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -171,6 +171,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu

Re: [U-Boot] [PATCH] arm: Fixed the offset for the no relocation.

2012-08-01 Thread Zhong Hongbo
On 08/01/2012 10:50 PM, Zhong Hongbo wrote:
> From: Zhong Hongbo 
> 
> When the u-boot address of destination equal to  __start,
> no relocation. relocation offset(r9) = 0.
> 
> Signed-off-by: Zhong Hongbo 
> ---
>  arch/arm/cpu/arm1136/start.S   |1 +
>  arch/arm/cpu/arm1176/start.S   |2 +-
>  arch/arm/cpu/arm720t/start.S   |1 +
>  arch/arm/cpu/arm920t/start.S   |1 +
>  arch/arm/cpu/arm925t/start.S   |1 +
>  arch/arm/cpu/arm926ejs/start.S |1 +
>  arch/arm/cpu/arm946es/start.S  |1 +
>  arch/arm/cpu/arm_intcm/start.S |1 +
>  arch/arm/cpu/ixp/start.S   |1 +
>  arch/arm/cpu/lh7a40x/start.S   |1 +
>  arch/arm/cpu/pxa/start.S   |1 +
>  arch/arm/cpu/s3c44b0/start.S   |1 +
>  arch/arm/cpu/sa1100/start.S|1 +
>  13 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
> index 2483c63..3752af9 100644
> --- a/arch/arm/cpu/arm1136/start.S
> +++ b/arch/arm/cpu/arm1136/start.S
> @@ -190,6 +190,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
> index dd1b73b..7de4af2 100644
> --- a/arch/arm/cpu/arm1176/start.S
> +++ b/arch/arm/cpu/arm1176/start.S
> @@ -252,7 +252,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> - moveq   r9, #0

Sorry, I base on my smdk64xx serial patch.
Will send V2 to fix it.

Thanks,
hongbo
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
> index 3b97e80..913065b 100644
> --- a/arch/arm/cpu/arm720t/start.S
> +++ b/arch/arm/cpu/arm720t/start.S
> @@ -167,6 +167,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
> index 9b8604e..14c9156 100644
> --- a/arch/arm/cpu/arm920t/start.S
> +++ b/arch/arm/cpu/arm920t/start.S
> @@ -210,6 +210,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
> index 1a54416..3a483f6 100644
> --- a/arch/arm/cpu/arm925t/start.S
> +++ b/arch/arm/cpu/arm925t/start.S
> @@ -204,6 +204,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
> index 6f05f1a..1b530dc 100644
> --- a/arch/arm/cpu/arm926ejs/start.S
> +++ b/arch/arm/cpu/arm926ejs/start.S
> @@ -235,6 +235,7 @@ stack_setup:
>   adr r0, _start
>   sub r9, r6, r0  /* r9 <- relocation offset */
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
> index b4d1d2d..30e2183 100644
> --- a/arch/arm/cpu/arm946es/start.S
> +++ b/arch/arm/cpu/arm946es/start.S
> @@ -175,6 +175,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
>   beq clear_bss   /* skip relocation */
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
> diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
> index b85e7d4..a133d19 100644
> --- a/arch/arm/cpu/arm_intcm/start.S
> +++ b/arch/arm/cpu/arm_intcm/start.S
> @@ -171,6 +171,7 @@ stack_setup:
>  
>   adr r0, _start
>   cmp r0, r6
> + moveq   r9, #0  /* no relocation. relocation offse

[U-Boot] [PATCH] arm: Fixed the offset for the no relocation.

2012-08-01 Thread Zhong Hongbo
From: Zhong Hongbo 

When the u-boot address of destination equal to  __start,
no relocation. relocation offset(r9) = 0.

Signed-off-by: Zhong Hongbo 
---
 arch/arm/cpu/arm1136/start.S   |1 +
 arch/arm/cpu/arm1176/start.S   |2 +-
 arch/arm/cpu/arm720t/start.S   |1 +
 arch/arm/cpu/arm920t/start.S   |1 +
 arch/arm/cpu/arm925t/start.S   |1 +
 arch/arm/cpu/arm926ejs/start.S |1 +
 arch/arm/cpu/arm946es/start.S  |1 +
 arch/arm/cpu/arm_intcm/start.S |1 +
 arch/arm/cpu/ixp/start.S   |1 +
 arch/arm/cpu/lh7a40x/start.S   |1 +
 arch/arm/cpu/pxa/start.S   |1 +
 arch/arm/cpu/s3c44b0/start.S   |1 +
 arch/arm/cpu/sa1100/start.S|1 +
 13 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 2483c63..3752af9 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -190,6 +190,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index dd1b73b..7de4af2 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -252,7 +252,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
-   moveq   r9, #0
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 3b97e80..913065b 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -167,6 +167,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 9b8604e..14c9156 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -210,6 +210,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 1a54416..3a483f6 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -204,6 +204,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 6f05f1a..1b530dc 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -235,6 +235,7 @@ stack_setup:
adr r0, _start
sub r9, r6, r0  /* r9 <- relocation offset */
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index b4d1d2d..30e2183 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -175,6 +175,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index b85e7d4..a133d19 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -171,6 +171,7 @@ stack_setup:
 
adr r0, _start
cmp r0, r6
+   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index 59c359a..c1

Re: [U-Boot] early_malloc outline

2012-08-01 Thread Tomas Hlavacek
Hi Graeme,

On Wed, Aug 1, 2012 at 4:57 AM, Graeme Russ  wrote:

> More specifically, we must not assume that we have a single, contiguous
> region of memory capable of holding pre-relocations early stack,
> pre-relocation global data, pre-console buffer, and early (pre-relocation)
> heap.

Agreed.

>
> Forget about 'locked cache lines' - That is only important when considering
> when to call enable_caches(). The cover the generic case (which covers all
> architectures) we simply need to keep in mind that enable_caches() can only
> be called _after_ the early heap has been moved to the final (SDRAM) heap.
> Therefore, we must keep in mind that any code which manipulated the early
> heap into the final heap is going to be performance-hindered.

Yes. And actually there might be platforms or boards that do not need
early_malloc for DM and since there are no other users yet we might
want to switch it off completely not to waste memory and CPU cycles on
initialization etc.

>
>> Pavel Hermann said that we would have to copy data twice (first before
>> the RAM is up and running and caches are still off and second after
>> RAM and dlmalloc is initialized).
>
> I think I understand why now - The idea is to blind-copy the early-heap
> into SDRAM, enable caches and then process the early heap into final heap.
> This _may_ provide a performance bonus on _some_ (most) cases

Exactly. But we are a bit afraid of this copy-twice process. In fact
in meantime between relocation start and second copying finish DM
would be inactive (DM tree will be unavailable, therefore it is going
to be impossible to use drivers through DM etc.)

> OK, I'm going to go out on a long and thin limb here (i.e. look out for
> daft ideas) and say that all we need before relocation and final heap
> initialisation is an early stack and an early heap (no global data or no
> pre-relocation buffer as they are currently implemented). What! I hear you
> say :)
>
> Well, why can't we put global data and pre-relocation buffer _on_ the early
> heap? Yes, it will be a bit tricky as there is some very early code (in
> assembler) that reads/writes to/from GD, but if GD is placed at the top of
> the heap, it's members can still be directly referenced.

Well, since I am new to U-Boot development and I have not even managed
to read and understand line-by-line or better
instruction-by-instruction the early init code for all architectures
except for ARM yet, I am not be able to appreciate nor understand all
implications nor implement this idea. But I can prepare the
early_mallocator for this by using  by using your frame header struct
early_heap_info and by implementing heap list traversal into
early_malloc().

(But it may be considered as dead code now, because without any
working early_sbrk() it would add extra complexity without any
benefit. And I am certainly not the right person who could attempt
making such a deep changes to borad_init_f, move GD to early_heap
etc.)

> And as for the question of fixing up pointer in the structures allocated on
> the early heap, that is entirely up to the user of the early heap as only
> they know what the contents of the structures mean.

Exactly. And I will blind-copy only used early_heap, not the whole
early_heap in order not to waste space and CPU cycles.


Thanks,
Tomas



-- 
Tomáš Hlaváček 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [V3 09/15] arm1176: Fixed No relocation.

2012-08-01 Thread Zhong Hongbo
On 07/29/2012 06:12 PM, Albert ARIBAUD wrote:
> Hi Zhong,
> 
> On Sat, 28 Jul 2012 17:35:42 +0800, Zhong Hongbo  wrote:
>> From: Zhong Hongbo 
>>
>> When It do not need to relocat for u-boot,
>> the offset(r9) of relocation should be set zero.
>>
>> Signed-off-by: Zhong Hongbo 
>> ---
>> Change for V3:
>>  - Replace mov with moveq.
>> Change for V2:
>>  - Seprate some code.
>> ---
>>  arch/arm/cpu/arm1176/start.S |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
>> index 761b7fe..dd1b73b 100644
>> --- a/arch/arm/cpu/arm1176/start.S
>> +++ b/arch/arm/cpu/arm1176/start.S
>> @@ -252,6 +252,7 @@ stack_setup:
>>  
>>  adr r0, _start
>>  cmp r0, r6
>> +moveq   r9, #0
>>  beq clear_bss   /* skip relocation */
>>  mov r1, r6  /* r1 <- scratch for copy_loop */
>>  ldr r3, _bss_start_ofs
> 
> I suspect this goes for other ARM arches as well, does it not?
> Please fix globally.
> 
> (considering this is the second time in a small period where such a global
> fixing is needed, I'll have a look at commonalizing start.S files across
> all ARM arches if possible and submit a patch for the coming window -- unless
> someone else has this ongoing already)
Hi Albert,

I will send a patch to modify the global arm platform.

Minkyu,

I will separate the patch from this serial.

Thanks,
hongbo

> 
> Amicalement,
> 

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


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Thomas Petazzoni
Le Wed, 1 Aug 2012 15:43:03 +0200,
Dirk Behme  a écrit :

> > The kernel has a pinctrl driver for i.MX 6, so I would rather suggest
> > to fix your imx6q-sabrelite.dts Device Tree source file so that the
> > audio device is properly associated with the correct pinmux
> > configuration.
> 
> I'm using
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=b7879fe6dad97ce08e8df0bf8d408942c436d358
> 
> > Each device can have a pinctrl-0 DT property, which points to one or
> > more pinmux configurations that are defined in imx6q.dtsi file. You can
> > add additional pinmux configurations here if needed.
> 
> Sounds like the above is incomplete, then?

Yes. If this device needs certain pins to be muxed in a certain
configuration, then it needs:

pinctrl-names = "default";
pinctrl-0 = <&pinctrl_some_config_name>;

And then in the imx6q.dtsi, the pinctrl_some_config_name pinctrl
configuration needs to be defined.

But I guess this starts to be a bit off-topic for the U-Boot list. What
about raising the issue with i.MX 6 kernel maintainers on LAKML instead?

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Dirk Behme

On 01.08.2012 15:33, Thomas Petazzoni wrote:

Le Wed, 1 Aug 2012 15:22:30 +0200,
Dirk Behme  a écrit :


Probably. But the question is still why this should be changed in
U-Boot.  Why doesn't the Linux driver set the pin mux configuration
it needs?
Sorry, I don't know. The Linux driver developers told me "there is no 
U-Boot dependency". Maybe they could answer this question? CCed.


The kernel has a pinctrl driver for i.MX 6, so I would rather suggest
to fix your imx6q-sabrelite.dts Device Tree source file so that the
audio device is properly associated with the correct pinmux
configuration.


I'm using

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=b7879fe6dad97ce08e8df0bf8d408942c436d358


Each device can have a pinctrl-0 DT property, which points to one or
more pinmux configurations that are defined in imx6q.dtsi file. You can
add additional pinmux configurations here if needed.


Sounds like the above is incomplete, then?


But yeah, definitely, the kernel shouldn't rely too much on U-Boot
having set the right pinmux configuration.


Best regards

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


Re: [U-Boot] [PATCH] MX28: Add SchulerControl SC_SPS_1 platform

2012-08-01 Thread Marek Vasut
CC Stefano:

> This i.MX28 platform supports the following:
> * 2x FEC ethernet
> * USB on USBH0
> * I2C EEPROM
> * SPI NVRAM
> * LEDs
> 
> Signed-off-by: Marek Vasut 
> Cc: Detlev Zundel 

[..]

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] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Thomas Petazzoni
Le Wed, 1 Aug 2012 15:22:30 +0200,
Dirk Behme  a écrit :

> > Probably. But the question is still why this should be changed in
> > U-Boot.  Why doesn't the Linux driver set the pin mux configuration
> > it needs?
> 
> Sorry, I don't know. The Linux driver developers told me "there is no 
> U-Boot dependency". Maybe they could answer this question? CCed.

The kernel has a pinctrl driver for i.MX 6, so I would rather suggest
to fix your imx6q-sabrelite.dts Device Tree source file so that the
audio device is properly associated with the correct pinmux
configuration.

Each device can have a pinctrl-0 DT property, which points to one or
more pinmux configurations that are defined in imx6q.dtsi file. You can
add additional pinmux configurations here if needed.

But yeah, definitely, the kernel shouldn't rely too much on U-Boot
having set the right pinmux configuration.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Dirk Behme

On 01.08.2012 14:55, Wolfgang Denk wrote:

Dear Dirk Behme,

In message <5019180c.4060...@de.bosch.com> you wrote:

It seems to me that the SGTL5000 kernel feature for the SabreLite was
developed with a Freescale U-Boot (patching the kernel with DT append)
and not tested with the mainline U-Boot.


Probably. But the question is still why this should be changed in
U-Boot.  Why doesn't the Linux driver set the pin mux configuration
it needs?


Sorry, I don't know. The Linux driver developers told me "there is no 
U-Boot dependency". Maybe they could answer this question? CCed.


Best regards

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


[U-Boot] [PATCH] MX28: Add SchulerControl SC_SPS_1 platform

2012-08-01 Thread Marek Vasut
This i.MX28 platform supports the following:
* 2x FEC ethernet
* USB on USBH0
* I2C EEPROM
* SPI NVRAM
* LEDs

Signed-off-by: Marek Vasut 
Cc: Detlev Zundel 
---
 board/schulercontrol/sc_sps_1/Makefile   |   47 +++
 board/schulercontrol/sc_sps_1/sc_sps_1.c |  113 
 board/schulercontrol/sc_sps_1/spl_boot.c |  165 
 board/schulercontrol/sc_sps_1/u-boot.bd  |   14 ++
 boards.cfg   |1 +
 include/configs/sc_sps_1.h   |  208 ++
 6 files changed, 548 insertions(+)
 create mode 100644 board/schulercontrol/sc_sps_1/Makefile
 create mode 100644 board/schulercontrol/sc_sps_1/sc_sps_1.c
 create mode 100644 board/schulercontrol/sc_sps_1/spl_boot.c
 create mode 100644 board/schulercontrol/sc_sps_1/u-boot.bd
 create mode 100644 include/configs/sc_sps_1.h

diff --git a/board/schulercontrol/sc_sps_1/Makefile 
b/board/schulercontrol/sc_sps_1/Makefile
new file mode 100644
index 000..24a1003
--- /dev/null
+++ b/board/schulercontrol/sc_sps_1/Makefile
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000-2012
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+ifndef CONFIG_SPL_BUILD
+COBJS  := sc_sps_1.o
+else
+COBJS  := spl_boot.o
+endif
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/schulercontrol/sc_sps_1/sc_sps_1.c 
b/board/schulercontrol/sc_sps_1/sc_sps_1.c
new file mode 100644
index 000..0fee289
--- /dev/null
+++ b/board/schulercontrol/sc_sps_1/sc_sps_1.c
@@ -0,0 +1,113 @@
+/*
+ * SchulerControl GmbH, SC_SPS_1 module
+ *
+ * Copyright (C) 2012 Marek Vasut 
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Functions
+ */
+int board_early_init_f(void)
+{
+   /* IO0 clock at 480MHz */
+   mx28_set_ioclk(MXC_IOCLK0, 48);
+   /* IO1 clock at 480MHz */
+   mx28_set_ioclk(MXC_IOCLK1, 48);
+
+   /* SSP0 clock at 96MHz */
+   mx28_set_sspclk(MXC_SSPCLK0, 96000, 0);
+   /* SSP2 clock at 96MHz */
+   mx28_set_sspclk(MXC_SSPCLK2, 96000, 0);
+
+#ifdef CONFIG_CMD_USB
+   mxs_iomux_setup_pad(MX28_PAD_AUART1_CTS__USB0_OVERCURRENT);
+   mxs_iomux_setup_pad(MX28_PAD_AUART2_TX__GPIO_3_9 |
+   MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);
+   gpio_direction_output(MX28_PAD_AUART2_TX__GPIO_3_9, 1);
+#endif
+
+   return 0;
+}
+
+int board_init(void)
+{
+   /* Adress of boot parameters */
+   gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+
+   return 0;
+}
+
+int dram_init(void)
+{
+   return mx28_dram_init();
+}
+
+#ifdef CONFIG_CMD_MMC
+int board_mmc_init(bd_t *bis)
+{
+   return mxsmmc_initialize(bis, 0, NULL);
+}
+#endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+   struct mx28_clkctrl_regs *clkctrl_regs =
+   (struct mx28_clkctrl_r

[U-Boot] [PATCH] SPI: Remove superfluous semicolon

2012-08-01 Thread Marek Vasut
This is from someone on IRC.

Signed-off-by: Marek Vasut 
Cc: Mike Frysinger 
Cc: Wolfgang Denk 
---
 common/cmd_spi.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/cmd_spi.c b/common/cmd_spi.c
index 8c623c9..eba5fb8 100644
--- a/common/cmd_spi.c
+++ b/common/cmd_spi.c
@@ -89,7 +89,7 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
cs = bus;
bus = CONFIG_DEFAULT_SPI_BUS;
}
-   if (*cp == '.');
+   if (*cp == '.')
mode = simple_strtoul(cp+1, NULL, 10);
}
if (argc >= 3)
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH 1/4] MX28: Fix up the MMC driver DMA mode

2012-08-01 Thread Marek Vasut
Bump?

> The DMA mode didn't properly configure the DMA_ENABLE bit in CTRL1
> Also, it was using SSP0 DMA channel for all SSP devices.
> 
> Signed-off-by: Marek Vasut 
> Cc: Wolfgang Denk 
> Cc: Stefano Babic 
> Cc: Fabio Estevam 
> Cc: Andy Fleming 
> ---
>  drivers/mmc/mxsmmc.c |   10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> NOTE: This series is for -next!
> 
> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> index 4187a94..a637db3 100644
> --- a/drivers/mmc/mxsmmc.c
> +++ b/drivers/mmc/mxsmmc.c
> @@ -79,6 +79,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) uint32_t *data_ptr;
>  #else
>   uint32_t cache_data_count;
> + int dmach;
>  #endif
> 
>   debug("MMC%d: CMD%d\n", mmc->block_dev.dev, cmd->cmdidx);
> @@ -201,6 +202,8 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) timeout = MXSMMC_MAX_TIMEOUT;
> 
>  #ifdef CONFIG_MXS_MMC_DMA
> + writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_set);
> +
>   if (data_count % ARCH_DMA_MINALIGN)
>   cache_data_count = roundup(data_count, ARCH_DMA_MINALIGN);
>   else
> @@ -222,8 +225,9 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) (data_count << MXS_DMA_DESC_BYTES_OFFSET);
> 
> 
> - mxs_dma_desc_append(MXS_DMA_CHANNEL_AHB_APBH_SSP0, priv->desc);
> - if (mxs_dma_go(MXS_DMA_CHANNEL_AHB_APBH_SSP0)) {
> + dmach = MXS_DMA_CHANNEL_AHB_APBH_SSP0 + priv->id;
> + mxs_dma_desc_append(dmach, priv->desc);
> + if (mxs_dma_go(dmach)) {
>   printf("MMC%d: DMA transfer failed\n", mmc->block_dev.dev);
>   return COMM_ERR;
>   }
> @@ -234,6 +238,8 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) (uint32_t)(priv->desc->cmd.address +
> cache_data_count));
>   }
>  #else
> + writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_clr);
> +
>   if (data->flags & MMC_DATA_READ) {
>   data_ptr = (uint32_t *)data->dest;
>   while (data_count && --timeout) {

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] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Wolfgang Denk
Dear Dirk Behme,

In message <5019180c.4060...@de.bosch.com> you wrote:
>
> It seems to me that the SGTL5000 kernel feature for the SabreLite was
> developed with a Freescale U-Boot (patching the kernel with DT append)
> and not tested with the mainline U-Boot.

Probably. But the question is still why this should be changed in
U-Boot.  Why doesn't the Linux driver set the pin mux configuration
it needs?

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
THIS IS A 100% MATTER  PRODUCT:  In  the  Unlikely  Event  That  This
Merchandise  Should  Contact  Antimatter  in Any Form, a Catastrophic
Explosion Will Result.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] arm : Atmel : add at91sam9x5ek board support

2012-08-01 Thread Andreas Bießmann
Dear Bo Shen,

On 06.07.12 05:21, Bo Shen wrote:
> Add at91sam9x5ek board support, this board support the following SoCs
>   AT91SAM9G15, AT91SAM9G25, AT91SAM9G35, AT91SAM9X25, AT91SAM9X35
> 
> Using at91sam9x5ek_nandflash to configure for the board
> Now only supports NAND with software ECC boot up
> 
> Signed-off-by: Bo Shen 
> ---

Applied to u-boot-atmel, thanks.

Best regards

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


Re: [U-Boot] [PATCH] doc/git-mailrc: update at91 and avr32

2012-08-01 Thread Andreas Bießmann
Dear Andreas Bießmann,

On 02.07.12 16:51, Andreas Bießmann wrote:
> Signed-off-by: Andreas Bießmann 
> ---
>  doc/git-mailrc |5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Dirk Behme

On 01.08.2012 13:26, Liu Hui-R64343 wrote:

-Original Message-
From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
On Behalf Of Dirk Behme
Sent: Wednesday, August 01, 2012 7:06 PM
To: u-boot@lists.denx.de
Cc: Dirk Behme
Subject: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO
and GPIO_3__CCM_CLKO2 pin mux

A recent Linux kernel (>= 3.5) has support for the SGTL 5000 sound on the
SabreLite board. To make this work, U-Boot has to configure the pin mux for
PAD_GPIO_0__CCM_CLKO and PAD_GPIO_3__CCM_CLKO2 correctly.


Why this can't be set in the kernel but relies on u-boot to configure it?


I don't know :(

It took me days to find this U-Boot dependency, thanks to Troy helping 
with this!


I enabled SGTL5000 sound in the kernel and it didn't work. Until I found 
that it works with the ER5 Freescale U-Boot, but not with the recent 
mainline one.


It seems to me that the SGTL5000 kernel feature for the SabreLite was 
developed with a Freescale U-Boot (patching the kernel with DT append) 
and not tested with the mainline U-Boot.


Best regards

Dirk


Jason

Taken from Freescale's ER5 U-Boot for the SabreLite.

Signed-off-by: Dirk Behme 
CC: Troy Kisky 
CC: Stefano Babic 
---
board/freescale/mx6qsabrelite/imximage.cfg |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

1.7.0.4

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







--
==
Dirk Behme  Robert Bosch Car Multimedia GmbH
CM-AI/PJ-CF32
Phone: +49 5121 49-3274 Dirk Behme
Fax:   +49 711 811 5053274  PO Box 77 77 77
mailto:dirk.be...@de.bosch.com  D-31132 Hildesheim - Germany

Bosch Group, Car Multimedia (CM)
 Automotive Navigation and Infotainment Systems (AI)
 ProJect - CoreFunctions (PJ-CF)

Robert Bosch Car Multimedia GmbH - Ein Unternehmen der Bosch Gruppe
Sitz: Hildesheim
Registergericht: Amtsgericht Hildesheim HRB 201334
Aufsichtsratsvorsitzender: Volkmar Denner
Geschäftsführung: Uwe Thomas, Michael Bolle, Robby Drave, Egbert Hellwig
==
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Liu Hui-R64343
>-Original Message-
>From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>On Behalf Of Dirk Behme
>Sent: Wednesday, August 01, 2012 7:06 PM
>To: u-boot@lists.denx.de
>Cc: Dirk Behme
>Subject: [U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO
>and GPIO_3__CCM_CLKO2 pin mux
>
>A recent Linux kernel (>= 3.5) has support for the SGTL 5000 sound on the
>SabreLite board. To make this work, U-Boot has to configure the pin mux for
>PAD_GPIO_0__CCM_CLKO and PAD_GPIO_3__CCM_CLKO2 correctly.

Why this can't be set in the kernel but relies on u-boot to configure it?

Jason
>
>Taken from Freescale's ER5 U-Boot for the SabreLite.
>
>Signed-off-by: Dirk Behme 
>CC: Troy Kisky 
>CC: Stefano Babic 
>---
> board/freescale/mx6qsabrelite/imximage.cfg |3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
>1.7.0.4
>
>___
>U-Boot mailing list
>U-Boot@lists.denx.de
>http://lists.denx.de/mailman/listinfo/u-boot


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


[U-Boot] [PATCH] mx6q: mx6qsabrelite: add GPIO_0__CCM_CLKO and GPIO_3__CCM_CLKO2 pin mux

2012-08-01 Thread Dirk Behme
A recent Linux kernel (>= 3.5) has support for the SGTL 5000 sound
on the SabreLite board. To make this work, U-Boot has to configure the
pin mux for PAD_GPIO_0__CCM_CLKO and PAD_GPIO_3__CCM_CLKO2 correctly.

Taken from Freescale's ER5 U-Boot for the SabreLite.

Signed-off-by: Dirk Behme 
CC: Troy Kisky 
CC: Stefano Babic 
---
 board/freescale/mx6qsabrelite/imximage.cfg |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6qsabrelite/imximage.cfg 
b/board/freescale/mx6qsabrelite/imximage.cfg
index 62498ab..2d7825a 100644
--- a/board/freescale/mx6qsabrelite/imximage.cfg
+++ b/board/freescale/mx6qsabrelite/imximage.cfg
@@ -168,3 +168,6 @@ DATA 4 0x020e0010 0xF0CF
 # set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7
 DATA 4 0x020e0018 0x007F007F
 DATA 4 0x020e001c 0x007F007F
+# set PAD_GPIO_0__CCM_CLKO and PAD_GPIO_3__CCM_CLKO2
+DATA 4 0x020e0220 0x
+DATA 4 0x020e022c 0x0004
\ No newline at end of file
-- 
1.7.0.4

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


Re: [U-Boot] [U-Boot-DM] List of offending drivers

2012-08-01 Thread Andreas Bießmann
Dear Marek Vasut,

On 27.07.12 01:18, Marek Vasut wrote:
> Hello,
> 
> Check the following list, it's the list of drivers scattered (misplaced) 
> across 
> the tree. The list is not complete and might be inaccurate. But it should 
> give a 
> good impression of what I'm going to break soon:
> 

> board/atmel/at91rm9200ek/led.c
> board/atmel/at91sam9260ek/led.c
> board/atmel/at91sam9261ek/led.c
> board/atmel/at91sam9263ek/led.c
> board/atmel/at91sam9m10g45ek/led.c
> board/atmel/at91sam9rlek/led.c

these atmel specific led stuff is basically for very early debug
(switching a LED after relocation, another one after board init, ..). It
also provides possibility to use it in assembler code sections e.g.
lowlevel_init.

I do not really care about that cause I normally use JTAG to debug early
code. The led switching at a specific stage could be done by one of the
other generic led drivers.

Beside that, I think for debugging early stage code without JTAG the
serial line is much better than a LED which can only provide two states.
Has anyone thought about that? Has anyone tried to add some
'early_printf' feature?

Best regards

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


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-01 Thread Andreas Bießmann
Dear Markus Hubig,

first of all:

---8<---
andreas@andreas-mbp % ./tools/checkpatch.pl
U-Boot-at91-Add-support-for-taskit-AT91SAM9G20-boards..patch
WARNING: Whitespace before semicolon
#214: FILE: board/taskit/stamp9g20/stamp9g20.c:123:
+   ;

total: 0 errors, 1 warnings, 484 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX
MULTISTATEMENT_MACRO_USE_DO_WHILE

U-Boot-at91-Add-support-for-taskit-AT91SAM9G20-boards..patch has style
problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
--->8---

I know this part is copied from other at91 boards but I wonder how we
should handle these while-loops without content.

On 30.07.12 20:01, Markus Hubig wrote:
> This adds support for the AT91SAM9G20 boards by taskit GmbH.
> Both boards, Stamp9G20 and PortuxG20, are integrated in one
> file. PortuxG20 is basically a SBC built around the Stamp9G20.
> 
> Signed-off-by: Markus Hubig 
> Cc: Andreas Bießmann 
> ---
>  board/taskit/stamp9g20/Makefile|   52 
>  board/taskit/stamp9g20/stamp9g20.c |  199 +++
>  boards.cfg |2 +
>  include/configs/stamp9g20.h|  225 
> 

MAINTAINER entry is missing

>  4 files changed, 478 insertions(+), 0 deletions(-)
>  create mode 100644 board/taskit/stamp9g20/Makefile
>  create mode 100644 board/taskit/stamp9g20/stamp9g20.c
>  create mode 100644 include/configs/stamp9g20.h
> 
> diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
> new file mode 100644
> index 000..e99bfaa
> --- /dev/null
> +++ b/board/taskit/stamp9g20/Makefile
> @@ -0,0 +1,52 @@
> +#
> +# (C) Copyright 2003-2008
> +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> +#
> +# (C) Copyright 2008
> +# Stelian Pop 
> +# Lead Tech Design 
> +#
> +# (C) Copyright 2012
> +# Markus Hubig 
> +# IMKO GmbH 
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  = $(obj)lib$(BOARD).o
> +
> +COBJS-y  += stamp9g20.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS-y))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/taskit/stamp9g20/stamp9g20.c 
> b/board/taskit/stamp9g20/stamp9g20.c
> new file mode 100644
> index 000..b87de51
> --- /dev/null
> +++ b/board/taskit/stamp9g20/stamp9g20.c
> @@ -0,0 +1,199 @@
> +/*
> + * (C) Copyright 2007-2008
> + * Stelian Pop 
> + * Lead Tech Design 
> + *
> + * Achim Ehrlich 
> + * taskit GmbH 
> + *
> + * (C) Copyright 2012-
> + * Markus Hubig 
> + * IMKO GmbH 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#ifdef CONFIG_MACB
> +# include 
> +# include 
> +#endif /* CONFIG_MACB */
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static void stamp9G20_nand_hw_init(void)
> +{
> + struct at91_smc *smc = (str

[U-Boot] [PATCH 7/7 V3] Enable SPI booting.

2012-08-01 Thread Rajeshwari Shinde
This patch enables SPI Booting for EXYNOS5

Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- None.
Changes in V3:
- None.
 board/samsung/smdk5250/Makefile   |2 +-
 board/samsung/smdk5250/{mmc_boot.c => spl_boot.c} |   31 +++-
 include/configs/smdk5250.h|5 +++
 3 files changed, 35 insertions(+), 3 deletions(-)
 rename board/samsung/smdk5250/{mmc_boot.c => spl_boot.c} (66%)

diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
index 1474fa8..47c6a5a 100644
--- a/board/samsung/smdk5250/Makefile
+++ b/board/samsung/smdk5250/Makefile
@@ -36,7 +36,7 @@ COBJS += smdk5250.o
 endif
 
 ifdef CONFIG_SPL_BUILD
-COBJS  += mmc_boot.o
+COBJS  += spl_boot.o
 endif
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/samsung/smdk5250/mmc_boot.c 
b/board/samsung/smdk5250/spl_boot.c
similarity index 66%
rename from board/samsung/smdk5250/mmc_boot.c
rename to board/samsung/smdk5250/spl_boot.c
index 449a919..d8f3c1e 100644
--- a/board/samsung/smdk5250/mmc_boot.c
+++ b/board/samsung/smdk5250/spl_boot.c
@@ -23,6 +23,16 @@
 #include
 #include
 
+enum boot_mode {
+   BOOT_MODE_MMC = 4,
+   BOOT_MODE_SERIAL = 20,
+   /* Boot based on Operating Mode pin settings */
+   BOOT_MODE_OM = 32,
+   BOOT_MODE_USB,  /* Boot using USB download */
+};
+
+   typedef u32 (*spi_copy_func_t)(u32 offset, u32 nblock, u32 dst);
+
 /*
 * Copy U-boot from mmc to RAM:
 * COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
@@ -30,9 +40,26 @@
 */
 void copy_uboot_to_ram(void)
 {
-   u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+   spi_copy_func_t spi_copy;
+   enum boot_mode bootmode;
+   u32 (*copy_bl2)(u32, u32, u32);
+
+   bootmode = readl(EXYNOS5_POWER_BASE) & OM_STAT;
 
-   copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
+   switch (bootmode) {
+   case BOOT_MODE_SERIAL:
+   spi_copy = *(spi_copy_func_t *)EXYNOS_COPY_SPI_FNPTR_ADDR;
+   spi_copy(SPI_FLASH_UBOOT_POS, CONFIG_BL2_SIZE,
+   CONFIG_SYS_TEXT_BASE);
+   break;
+   case BOOT_MODE_MMC:
+   copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+   copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT,
+   CONFIG_SYS_TEXT_BASE);
+   break;
+   default:
+   break;
+   }
 }
 
 void board_init_f(unsigned long bootflag)
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 29b7ac6..4b9093c 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -192,6 +192,11 @@
 /* U-boot copy size from boot Media to DRAM.*/
 #define BL2_START_OFFSET   (CONFIG_BL2_OFFSET/512)
 #define BL2_SIZE_BLOC_COUNT(CONFIG_BL2_SIZE/512)
+
+#define OM_STAT(0x1f << 1)
+#define EXYNOS_COPY_SPI_FNPTR_ADDR 0x02020058
+#define SPI_FLASH_UBOOT_POS(CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE)
+
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_IRAM_STACK  0x0205
-- 
1.7.4.4

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


[U-Boot] [PATCH 5/7 V3] SPI: Add SPI Driver for EXYNOS.

2012-08-01 Thread Rajeshwari Shinde
This patch adds SPI driver for EXYNOS.

Signed-off-by: Simon Glass 
Signed-off-by: Padmavathi Venna 
Signed-off-by: Gabe Black 
Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- None.
Changes in V3:
- Removed SPI_SLAVE flag.
 arch/arm/include/asm/arch-exynos/spi.h |   78 +++
 drivers/spi/Makefile   |1 +
 drivers/spi/exynos_spi.c   |  368 
 3 files changed, 447 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/spi.h
 create mode 100644 drivers/spi/exynos_spi.c

diff --git a/arch/arm/include/asm/arch-exynos/spi.h 
b/arch/arm/include/asm/arch-exynos/spi.h
new file mode 100644
index 000..7cab1e9
--- /dev/null
+++ b/arch/arm/include/asm/arch-exynos/spi.h
@@ -0,0 +1,78 @@
+/*
+ * (C) Copyright 2012 SAMSUNG Electronics
+ * Padmavathi Venna 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_EXYNOS_COMMON_SPI_H_
+#define __ASM_ARCH_EXYNOS_COMMON_SPI_H_
+
+#ifndef __ASSEMBLY__
+
+/* SPI peripheral register map; padded to 64KB */
+struct exynos_spi {
+   unsigned intch_cfg; /* 0x00 */
+   unsigned char   reserved0[4];
+   unsigned intmode_cfg;   /* 0x08 */
+   unsigned intcs_reg; /* 0x0c */
+   unsigned char   reserved1[4];
+   unsigned intspi_sts;/* 0x14 */
+   unsigned inttx_data;/* 0x18 */
+   unsigned intrx_data;/* 0x1c */
+   unsigned intpkt_cnt;/* 0x20 */
+   unsigned char   reserved2[4];
+   unsigned char   reserved3[4];
+   unsigned intfb_clk; /* 0x2c */
+   unsigned char   padding[0xffd0];
+};
+
+#define EXYNOS_SPI_MAX_FREQ5000
+
+#define SPI_TIMEOUT_MS 10
+
+/* SPI_CHCFG */
+#define SPI_CH_HS_EN   (1 << 6)
+#define SPI_CH_RST (1 << 5)
+#define SPI_SLAVE_MODE (1 << 4)
+#define SPI_CH_CPOL_L  (1 << 3)
+#define SPI_CH_CPHA_B  (1 << 2)
+#define SPI_RX_CH_ON   (1 << 1)
+#define SPI_TX_CH_ON   (1 << 0)
+
+/* SPI_MODECFG */
+#define SPI_MODE_CH_WIDTH_WORD (0x2 << 29)
+#define SPI_MODE_BUS_WIDTH_WORD(0x2 << 17)
+
+/* SPI_CSREG */
+#define SPI_SLAVE_SIG_INACT(1 << 0)
+
+/* SPI_STS */
+#define SPI_ST_TX_DONE (1 << 25)
+#define SPI_FIFO_LVL_MASK  0x1ff
+#define SPI_TX_LVL_OFFSET  6
+#define SPI_RX_LVL_OFFSET  15
+
+/* Feedback Delay */
+#define SPI_CLK_BYPASS (0 << 0)
+#define SPI_FB_DELAY_90(1 << 0)
+#define SPI_FB_DELAY_180   (2 << 0)
+#define SPI_FB_DELAY_270   (3 << 0)
+
+/* Packet Count */
+#define SPI_PACKET_CNT_EN  (1 << 16)
+
+#endif /* __ASSEMBLY__ */
+#endif
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index c20f1f2..f15adf0 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
 COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
 COBJS-$(CONFIG_CF_SPI) += cf_spi.o
 COBJS-$(CONFIG_DAVINCI_SPI) += davinci_spi.o
+COBJS-$(CONFIG_EXYNOS_SPI) += exynos_spi.o
 COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o
 COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
new file mode 100644
index 000..a633f95
--- /dev/null
+++ b/drivers/spi/exynos_spi.c
@@ -0,0 +1,368 @@
+/*
+ * (C) Copyright 2012 SAMSUNG Electronics
+ * Padmavathi Venna 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

[U-Boot] [PATCH 6/7 V3] EXYNOS5: Enable SPI

2012-08-01 Thread Rajeshwari Shinde
This patch enables SPI driver for EXYNOS5.

Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- None.
Changes in V3:
- Corrected the warning message.
 board/samsung/smdk5250/smdk5250.c |4 
 include/configs/smdk5250.h|   23 ++-
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index a5816e4..069c9e8 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -63,6 +64,9 @@ static int smc9115_pre_init(void)
 int board_init(void)
 {
gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
+#ifdef CONFIG_EXYNOS_SPI
+   spi_init();
+#endif
return 0;
 }
 
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 27dab76..29b7ac6 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -167,7 +167,7 @@
 #undef CONFIG_CMD_IMLS
 #define CONFIG_IDENT_STRING" for SMDK5250"
 
-#define CONFIG_ENV_IS_IN_MMC
+/*#define CONFIG_ENV_IS_IN_MMC*/
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
 #define CONFIG_SECURE_BL1_ONLY
@@ -216,6 +216,27 @@
 #define CONFIG_ENV_SROM_BANK   1
 #endif /*CONFIG_CMD_NET*/
 
+/* SPI */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SPI_FLASH
+
+#ifdef CONFIG_SPI_FLASH
+#define CONFIG_EXYNOS_SPI
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SPI
+#define CONFIG_SPI_FLASH_WINBOND
+#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
+#define CONFIG_SF_DEFAULT_SPEED5000
+#define EXYNOS5_SPI_NUM_CONTROLLERS5
+#endif
+
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_MODESPI_MODE_0
+#define CONFIG_ENV_SECT_SIZE   CONFIG_ENV_SIZE
+#define CONFIG_ENV_SPI_BUS 1
+#define CONFIG_ENV_SPI_MAX_HZ  5000
+#endif
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.4.4

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


[U-Boot] [PATCH 4/7 V3] EXYNOS5: Add base address for SPI.

2012-08-01 Thread Rajeshwari Shinde
Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- None
Changes in V3:
- None.
 arch/arm/include/asm/arch-exynos/cpu.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index 0e6ea87..89c2dd3 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -51,11 +51,13 @@
 #define EXYNOS4_UART_BASE  0x1380
 #define EXYNOS4_I2C_BASE   0x1386
 #define EXYNOS4_ADC_BASE   0x1391
+#define EXYNOS4_SPI_BASE   0x1392
 #define EXYNOS4_PWMTIMER_BASE  0x139D
 #define EXYNOS4_MODEM_BASE 0x13A0
 #define EXYNOS4_USBPHY_CONTROL 0x10020704
 
 #define EXYNOS4_GPIO_PART4_BASEDEVICE_NOT_AVAILABLE
+#define EXYNOS4_SPI_ISP_BASE   DEVICE_NOT_AVAILABLE
 
 /* EXYNOS5 */
 #define EXYNOS5_I2C_SPACING0x1
@@ -80,7 +82,9 @@
 #define EXYNOS5_SROMC_BASE 0x1225
 #define EXYNOS5_UART_BASE  0x12C0
 #define EXYNOS5_I2C_BASE   0x12C6
+#define EXYNOS5_SPI_BASE   0x12D2
 #define EXYNOS5_PWMTIMER_BASE  0x12DD
+#define EXYNOS5_SPI_ISP_BASE   0x131A
 #define EXYNOS5_GPIO_PART2_BASE0x1340
 #define EXYNOS5_FIMD_BASE  0x1440
 
@@ -170,6 +174,8 @@ SAMSUNG_BASE(usb_ehci, USB_HOST_EHCI_BASE)
 SAMSUNG_BASE(usb_otg, USBOTG_BASE)
 SAMSUNG_BASE(watchdog, WATCHDOG_BASE)
 SAMSUNG_BASE(power, POWER_BASE)
+SAMSUNG_BASE(spi, SPI_BASE)
+SAMSUNG_BASE(spi_isp, SPI_ISP_BASE)
 #endif
 
 #endif /* _EXYNOS4_CPU_H */
-- 
1.7.4.4

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


[U-Boot] [PATCH 3/7 V3] EXYNOS: Add clock for SPI.

2012-08-01 Thread Rajeshwari Shinde
This patch adds api to calculate and set the clock for SPI channels

Signed-off-by: Simon Glass 
Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- None
Changes in V3:
- Corrected Warning messages.
 arch/arm/cpu/armv7/exynos/clock.c  |  124 
 arch/arm/include/asm/arch-exynos/clk.h |4 +-
 2 files changed, 127 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index de3db8e..2aa511e 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -628,6 +628,122 @@ static unsigned long exynos5_get_i2c_clk(void)
return aclk_66;
 }
 
+/**
+ * Linearly searches for the most accurate main and fine stage clock scalars
+ * (divisors) for a specified target frequency and scalar bit sizes by checking
+ * all multiples of main_scalar_bits values. Will always return scalars up to 
or
+ * slower than target.
+ *
+ * @param main_scalar_bits Number of main scalar bits, must be > 0 and < 32
+ * @param fine_scalar_bits Number of fine scalar bits, must be > 0 and < 32
+ * @param input_freq   Clock frequency to be scaled in Hz
+ * @param target_freq  Desired clock frequency in Hz
+ * @param best_fine_scalar Pointer to store the fine stage divisor
+ *
+ * @return best_main_scalarMain scalar for desired frequency or -1 if none
+ * found
+ */
+static int clock_calc_best_scalar(unsigned int main_scaler_bits,
+   unsigned int fine_scalar_bits, unsigned int input_rate,
+   unsigned int target_rate, unsigned int *best_fine_scalar)
+{
+   int i;
+   int best_main_scalar = -1;
+   unsigned int best_error = target_rate;
+   const unsigned int cap = (1 << fine_scalar_bits) - 1;
+   const unsigned int loops = 1 << main_scaler_bits;
+
+   debug("Input Rate is %u, Target is %u, Cap is %u\n", input_rate,
+   target_rate, cap);
+
+   assert(best_fine_scalar != NULL);
+   assert(main_scaler_bits <= fine_scalar_bits);
+
+   *best_fine_scalar = 1;
+
+   if (input_rate == 0 || target_rate == 0)
+   return -1;
+
+   if (target_rate >= input_rate)
+   return 1;
+
+   for (i = 1; i <= loops; i++) {
+   const unsigned int effective_div = max(min(input_rate / i /
+   target_rate, cap), 1);
+   const unsigned int effective_rate = input_rate / i /
+   effective_div;
+   const int error = target_rate - effective_rate;
+
+   debug("%d|effdiv:%u, effrate:%u, error:%d\n", i, effective_div,
+   effective_rate, error);
+
+   if (error >= 0 && error <= best_error) {
+   best_error = error;
+   best_main_scalar = i;
+   *best_fine_scalar = effective_div;
+   }
+   }
+
+   return best_main_scalar;
+}
+
+static int exynos5_spi_set_clock_rate(enum periph_id periph_id,
+   unsigned int rate)
+{
+   struct exynos5_clock *clk =
+   (struct exynos5_clock *)samsung_get_base_clock();
+   int main;
+   unsigned int fine;
+   unsigned shift, pre_shift;
+   unsigned mask = 0xff;
+   u32 *reg;
+
+   main = clock_calc_best_scalar(4, 8, 4, rate, &fine);
+   if (main < 0) {
+   debug("%s: Cannot set clock rate for periph %d",
+   __func__, periph_id);
+   return -1;
+   }
+   main = main - 1;
+   fine = fine - 1;
+
+   switch (periph_id) {
+   case PERIPH_ID_SPI0:
+   reg = &clk->div_peric1;
+   shift = 0;
+   pre_shift = 8;
+   break;
+   case PERIPH_ID_SPI1:
+   reg = &clk->div_peric1;
+   shift = 16;
+   pre_shift = 24;
+   break;
+   case PERIPH_ID_SPI2:
+   reg = &clk->div_peric2;
+   shift = 0;
+   pre_shift = 8;
+   break;
+   case PERIPH_ID_SPI3:
+   reg = &clk->sclk_div_isp;
+   shift = 0;
+   pre_shift = 4;
+   break;
+   case PERIPH_ID_SPI4:
+   reg = &clk->sclk_div_isp;
+   shift = 12;
+   pre_shift = 16;
+   break;
+   default:
+   debug("%s: Unsupported peripheral ID %d\n", __func__,
+ periph_id);
+   return -1;
+   }
+   clrsetbits_le32(reg, mask << shift, (main & mask) << shift);
+   clrsetbits_le32(reg, mask << pre_shift, (fine & mask) << pre_shift);
+
+   return 0;
+}
+
 unsigned long get_pll_clk(int pllreg)
 {
if (cpu_is_exynos5())
@@ -697,3 +813,11 @@ void set_mipi_clk(void)
if (cpu_is_exynos4())
exynos

[U-Boot] [PATCH 1/7 V3] EXYNOS5: Add pinmux support for SPI

2012-08-01 Thread Rajeshwari Shinde
This patch adds pinmux support for SPI channels

Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- None.
Changes in V3:
- Removed the slave flag for SPI.
 arch/arm/cpu/armv7/exynos/pinmux.c|   51 -
 arch/arm/include/asm/arch-exynos/periph.h |5 +++
 2 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 7776add..13f75e0 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -230,6 +230,49 @@ static void exynos5_i2c_config(int peripheral, int flags)
}
 }
 
+void exynos5_spi_config(int peripheral)
+{
+   int cfg = 0, pin = 0, i;
+   struct s5p_gpio_bank *bank = NULL;
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+   struct exynos5_gpio_part2 *gpio2 =
+   (struct exynos5_gpio_part2 *) samsung_get_base_gpio_part2();
+
+   switch (peripheral) {
+   case PERIPH_ID_SPI0:
+   bank = &gpio1->a2;
+   cfg = GPIO_FUNC(0x2);
+   pin = 0;
+   break;
+   case PERIPH_ID_SPI1:
+   bank = &gpio1->a2;
+   cfg = GPIO_FUNC(0x2);
+   pin = 4;
+   break;
+   case PERIPH_ID_SPI2:
+   bank = &gpio1->b1;
+   cfg = GPIO_FUNC(0x5);
+   pin = 1;
+   break;
+   case PERIPH_ID_SPI3:
+   bank = &gpio2->f1;
+   cfg = GPIO_FUNC(0x2);
+   pin = 0;
+   break;
+   case PERIPH_ID_SPI4:
+   for (i = 2; i < 4; i++)
+   s5p_gpio_cfg_pin(&gpio2->f0, i, GPIO_FUNC(0x4));
+   for (i = 4; i < 6; i++)
+   s5p_gpio_cfg_pin(&gpio2->e0, i, GPIO_FUNC(0x4));
+   break;
+   }
+   if (peripheral != PERIPH_ID_SPI4) {
+   for (i = pin; i < pin + 4; i++)
+   s5p_gpio_cfg_pin(bank, i, cfg);
+   }
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
switch (peripheral) {
@@ -257,11 +300,17 @@ static int exynos5_pinmux_config(int peripheral, int 
flags)
case PERIPH_ID_I2C7:
exynos5_i2c_config(peripheral, flags);
break;
+   case PERIPH_ID_SPI0:
+   case PERIPH_ID_SPI1:
+   case PERIPH_ID_SPI2:
+   case PERIPH_ID_SPI3:
+   case PERIPH_ID_SPI4:
+   exynos5_spi_config(peripheral);
+   break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return -1;
}
-
return 0;
 }
 
diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
b/arch/arm/include/asm/arch-exynos/periph.h
index b861d7d..dafc3f3 100644
--- a/arch/arm/include/asm/arch-exynos/periph.h
+++ b/arch/arm/include/asm/arch-exynos/periph.h
@@ -43,6 +43,11 @@ enum periph_id {
PERIPH_ID_SDMMC2,
PERIPH_ID_SDMMC3,
PERIPH_ID_SROMC,
+   PERIPH_ID_SPI0,
+   PERIPH_ID_SPI1,
+   PERIPH_ID_SPI2,
+   PERIPH_ID_SPI3,
+   PERIPH_ID_SPI4,
PERIPH_ID_UART0,
PERIPH_ID_UART1,
PERIPH_ID_UART2,
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/7 V3] SPI: Add W25Q32 to Winbond SPI flash table

2012-08-01 Thread Rajeshwari Shinde
SMDK EVT1  has a different Winbond part, added its part details
to the SPI flash table

Signed-off-by: Abhilash Kesavan 
Signed-off-by: Rajeshwari Shinde 
---
Changes in V2:
- Corrected the commit message.
Changes in V3:
- None.
 drivers/mtd/spi/winbond.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/spi/winbond.c b/drivers/mtd/spi/winbond.c
index c20faa2..b345efc 100644
--- a/drivers/mtd/spi/winbond.c
+++ b/drivers/mtd/spi/winbond.c
@@ -107,6 +107,14 @@ static const struct winbond_spi_flash_params 
winbond_spi_flash_table[] = {
.nr_blocks  = 256,
.name   = "W25Q128",
},
+   {
+   .id = 0x5014,
+   .l2_page_size   = 8,
+   .pages_per_sector   = 16,
+   .sectors_per_block  = 16,
+   .nr_blocks  = 128,
+   .name   = "W25Q80",
+   },
 };
 
 static int winbond_erase(struct spi_flash *flash, u32 offset, size_t len)
-- 
1.7.4.4

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


[U-Boot] [PATCH 0/7 V3] EXYNOS5: Enable SPI support

2012-08-01 Thread Rajeshwari Shinde
This patch set adds SPI driver for EXYNOS5 and enables same.

This patchset is based on top of latest V7 I2C patches which
are merged in u-boot-i2c.
url for same:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/136058

Changes in V2:
- Correted the Commit message.
Changes in V3:
- Removed SPI_SLAVE Flag.
- Corrected warning messages.

Rajeshwari Shinde (7):
  EXYNOS5: Add pinmux support for SPI
  SPI: Add W25Q32 to Winbond SPI flash table
  EXYNOS: Add clock for SPI.
  EXYNOS5: Add base address for SPI.
  SPI: Add SPI Driver for EXYNOS.
  EXYNOS5: Enable SPI
  Enable SPI booting.

 arch/arm/cpu/armv7/exynos/clock.c |  124 +++
 arch/arm/cpu/armv7/exynos/pinmux.c|   51 +++-
 arch/arm/include/asm/arch-exynos/clk.h|4 +-
 arch/arm/include/asm/arch-exynos/cpu.h|6 +
 arch/arm/include/asm/arch-exynos/periph.h |5 +
 arch/arm/include/asm/arch-exynos/spi.h|   78 +
 board/samsung/smdk5250/Makefile   |2 +-
 board/samsung/smdk5250/smdk5250.c |4 +
 board/samsung/smdk5250/{mmc_boot.c => spl_boot.c} |   31 ++-
 drivers/mtd/spi/winbond.c |8 +
 drivers/spi/Makefile  |1 +
 drivers/spi/exynos_spi.c  |  368 +
 include/configs/smdk5250.h|   28 ++-
 13 files changed, 704 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/spi.h
 rename board/samsung/smdk5250/{mmc_boot.c => spl_boot.c} (66%)
 create mode 100644 drivers/spi/exynos_spi.c

-- 
1.7.4.4

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


Re: [U-Boot] [PATCH v4] arm : Atmel : add at91sam9x5ek board support

2012-08-01 Thread Bo Shen

Hi Andreas,

On 8/1/2012 16:20, Andreas Bießmann wrote:

Dear Bo,

On 26.07.12 12:02, Bo Shen wrote:

On 7/6/2012 11:21, Bo Shen wrote:

Add at91sam9x5ek board support, this board support the following SoCs
AT91SAM9G15, AT91SAM9G25, AT91SAM9G35, AT91SAM9X25, AT91SAM9X35

Using at91sam9x5ek_nandflash to configure for the board
Now only supports NAND with software ECC boot up

Signed-off-by: Bo Shen 
---
This patch is based on git://git.denx.de/u-boot-atmel.git



ping


I'm just back from vacation, will it apply ASAP.


Thanks

Best Regards,

Bo Shen



best regards

Andreas Bießmann



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


Re: [U-Boot] [PATCH v4] arm : Atmel : add at91sam9x5ek board support

2012-08-01 Thread Andreas Bießmann
Dear Bo,

On 26.07.12 12:02, Bo Shen wrote:
> On 7/6/2012 11:21, Bo Shen wrote:
>> Add at91sam9x5ek board support, this board support the following SoCs
>>AT91SAM9G15, AT91SAM9G25, AT91SAM9G35, AT91SAM9X25, AT91SAM9X35
>>
>> Using at91sam9x5ek_nandflash to configure for the board
>> Now only supports NAND with software ECC boot up
>>
>> Signed-off-by: Bo Shen 
>> ---
>> This patch is based on git://git.denx.de/u-boot-atmel.git
>>
> 
> ping

I'm just back from vacation, will it apply ASAP.

best regards

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


Re: [U-Boot] [PATCH] doc/git-mailrc: update at91 and avr32

2012-08-01 Thread Andreas Bießmann
Dear Mike Frysinger,

On 19.07.12 05:33, Mike Frysinger wrote:
> On Monday 02 July 2012 10:51:39 Andreas Bießmann wrote:
>> --- a/doc/git-mailrc
>> +++ b/doc/git-mailrc
> 
> i would just run this through your avr tree as part of your next pull request

seems best, will do so.

best regards

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


Re: [U-Boot] [PATCH] lsxl: support power switch

2012-08-01 Thread Prafulla Wadaskar


> -Original Message-
> From: Michael Walle [mailto:mich...@walle.cc]
> Sent: 01 August 2012 01:58
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de
> Subject: Re: [PATCH] lsxl: support power switch
> 
> Am Dienstag 31 Juli 2012, 13:12:19 schrieb Prafulla Wadaskar:
> > > -Original Message-
> > > From: Michael Walle [mailto:mich...@walle.cc]
> > > Sent: 31 July 2012 16:22
> > > To: Prafulla Wadaskar
> > > Cc: Michael Walle; u-boot@lists.denx.de
> > > Subject: RE: [PATCH] lsxl: support power switch
> > >
> > > On Tue, July 31, 2012 07:59, Prafulla Wadaskar wrote:
> > > >> -Original Message-
> > > >> From: Michael Walle [mailto:mich...@walle.cc]
> > > >> Sent: 31 July 2012 02:17
> > > >> To: u-boot@lists.denx.de
> > > >> Cc: Michael Walle; Prafulla Wadaskar
> > > >> Subject: [PATCH] lsxl: support power switch
> > > >>
> > > >> This patch restores the Linkstation's original behaviour when
> > >
> > > powering
> > >
> > > >> off.
> > > >> Once the (soft) power switch is turned off, linux will reboot
> and
> > >
> > > the
> > >
> > > >> bootloader turns off HDD and USB power. Then it loops as long
> as
> > >
> > > the
> > >
> > > >> switch
> > > >> is in the off position, before continuing the boot process
> again.
> > > >>
> > > >> Additionally, this patch fixes the board function
> set_led(LED_OFF).
> > > >>
> > > >> Signed-off-by: Michael Walle 
> > > >> Cc: Prafulla Wadaskar 
> > > >> ---
> > > >>
> > > >>  board/buffalo/lsxl/lsxl.c |   22 +-
> > > >>  1 files changed, 21 insertions(+), 1 deletions(-)
> > > >>
> > > >> diff --git a/board/buffalo/lsxl/lsxl.c
> b/board/buffalo/lsxl/lsxl.c
> > > >> index fe15511..b3f31d6 100644
> > > >> --- a/board/buffalo/lsxl/lsxl.c
> > > >> +++ b/board/buffalo/lsxl/lsxl.c
> > > >> @@ -158,7 +158,7 @@ static void set_led(int state)
> > > >>
> > > >>  {
> > > >>
> > > >>switch (state) {
> > > >>
> > > >>case LED_OFF:
> > > >> -  __set_led(0, 0, 0, 0, 0, 0);
> > > >> +  __set_led(0, 0, 0, 1, 1, 1);
> > > >>
> > > >>break;
> > > >>
> > > >>case LED_ALARM_ON:
> > > >>__set_led(0, 0, 0, 0, 1, 1);
> > > >>
> > > >> @@ -192,6 +192,25 @@ int board_init(void)
> > > >>
> > > >>  }
> > > >>
> > > >>  #ifdef CONFIG_MISC_INIT_R
> > > >>
> > > >> +static void check_power_switch(void)
> > > >> +{
> > > >> +  if (kw_gpio_get_value(GPIO_POWER_SWITCH)) {
> > > >> +  /* turn off HDD and USB power */
> > > >> +  kw_gpio_set_value(GPIO_HDD_POWER, 0);
> > > >> +  kw_gpio_set_value(GPIO_USB_VBUS, 0);
> > > >> +  set_led(LED_OFF);
> > > >> +
> > > >> +  /* loop until released */
> > > >> +  while (kw_gpio_get_value(GPIO_POWER_SWITCH))
> > > >> +  ;
> > > >
> > > > Please avoid infinite loop, may you introduce timeout?
> > >
> > > actually, thats the use case, to loop indefinitely ;) See the
> commit
> > > message. The GPIO is a switch not a button. As long as it is
> switched
> > > to
> > > "Power Off" uboot should loop.
> >
> > Okay got it.
> > Ack for this patch.
> 
> ok thanks, can you apply it to your repository?
> 

Sure..

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


Re: [U-Boot] [PATCH v3 5/7] dfu:cmd: Support for DFU u-boot command

2012-08-01 Thread Lukasz Majewski
Hi Stephen Warren,

> On 07/31/2012 12:37 AM, Lukasz Majewski wrote:
> > Support for u-boot's "dfu   [list]" command.
> 
> > +U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
> > +   "Device Firmware Upgrade",
> > +   "  [list]\n"
> > +   "  - device firmware upgrade on a device \n"
> > +   "attached to interface \n"
> > +   "[list] - list available alt settings"
> > +);
> 
> Hmm. Is there any way to make this work without specifying "interface
> dev", or to allow specifying multiple "interface dev" entries? On a
> system with all of eMMC, NAND, and SPI, I'd like to just run "dfu" as
> the U-Boot command, and have the host specify which of those "devices"
> it wants to download to using the DFU protocol. So, if flashing a
> bunch of devices, there is no need to interact with U-Boot over both
> serial and USB in order to invoke the dfu command multiple times.

It would be possible by specifying proper altsettings e.g.:
a1 mmc-boot
a2 mmc-uImage
a3 nand-part0
a4 nand-part1
etc.

However, I think that for the start, the approach proposed here (as dfu
mmc 0 command call) is sufficient.

This approach is used with several file systems calls (e.g. fatload
mmc ... , fatwrite mmc ... etc.) and in my opinion it is consistent.

> 
> Somewhat related to this, it looks like the eMMC support doesn't allow
> the HW partition to be specified; it would be nice to expose alt
> settings for all of:
> 
> a) Each individual HW partition (boot0/1 if present, general0/1/2/3 if
> present, the user area, maybe the replay block)

I'm fully aware of this problem.
In the eMMC case, the access to boot partitions will be served by
defining special alt settings for DFU.

Those altsettings will be defined as follows:
-a[N] boot0
-a[N+1] boot1

Prerequisite for this functionality is support of "boot"
command, which will allow switching of the MMC available address spaces
(e.g. between boot0/boot1 and user accessible space).

> 
> b) Perhaps also a linearized view of the raw eMMC (LBAs 0..boot_size-1
> write to boot 0, LBAs boot_size..(2*boot_size)-1 write to boot1, LBAs
> 2*boot_size..end_of_device write to user area for example).

Access to partitions will be done differently. I assume that each eMMC
memory (the user accessible part) will be equipped with MBR or GPT
definition.

For this reason I'm now developing the USB Mass Storage (UMS) gadget to
export eMMC to host PC.
This solves the problem with accessing separate partitions. 

Please also be aware, that DFU shall be used only for relatively small
files (due to small EP0 bandwidth).

Large files shall be copied with UMS.

-- 
Best regards,

Lukasz Majewski

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