* [PATCH] some minor fixes for the netX arch
@ 2012-04-20 13:06 Juergen Beisert
2012-04-20 13:06 ` [PATCH 1/6] netX: just a style fix Juergen Beisert
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox
Nothing exciting...
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] netX: just a style fix
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
@ 2012-04-20 13:06 ` Juergen Beisert
2012-04-20 13:06 ` [PATCH 2/6] netX: use correct sized pointers Juergen Beisert
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
arch/arm/mach-netx/generic.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index 8810e6d..e4763c6 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -33,11 +33,11 @@ struct fw_header {
static int xc_check_ptr(int xcno, unsigned long adr, unsigned int size)
{
- if( adr >= NETX_PA_XMAC(xcno) &&
+ if (adr >= NETX_PA_XMAC(xcno) &&
adr + size < NETX_PA_XMAC(xcno) + XMAC_MEM_SIZE)
return 0;
- if( adr >= NETX_PA_XPEC(xcno) &&
+ if (adr >= NETX_PA_XPEC(xcno) &&
adr + size < NETX_PA_XPEC(xcno) + XPEC_MEM_SIZE)
return 0;
@@ -49,12 +49,11 @@ static int xc_patch(int xcno, void *patch, int count)
{
unsigned int adr, val, *p = patch;
-/* printf("%s: patch: %p size: %d\n",__FUNCTION__,patch,count); */
int i;
- for(i=0; i<count; i++) {
+ for (i = 0; i < count; i++) {
adr = *p++;
val = *p++;
- if( xc_check_ptr(xcno, adr, 1) < 0)
+ if (xc_check_ptr(xcno, adr, 1) < 0)
return -1;
*(volatile unsigned int *)adr = val;
}
@@ -66,7 +65,7 @@ static void memset32(void *s, int c, int n)
int i;
unsigned int *t = s;
- for(i=0; i<(n>>2); i++)
+ for (i = 0; i < (n >> 2); i++)
*t++ = 0;
}
@@ -75,11 +74,12 @@ static void memcpy32(void *trg, void *src, int size)
int i;
unsigned int *t = trg;
unsigned int *s = src;
- for(i=0; i<(size>>2); i++)
+ for (i = 0; i < (size >> 2); i++)
*t++ = *s++;
}
-int loadxc(int xcno) {
+int loadxc(int xcno)
+{
/* stop xmac / xpec */
XMAC_REG(xcno, XMAC_RPU_HOLD_PC) = RPU_HOLD_PC;
XMAC_REG(xcno, XMAC_TPU_HOLD_PC) = TPU_HOLD_PC;
@@ -92,7 +92,7 @@ int loadxc(int xcno) {
memset32((void*)NETX_PA_XMAC(xcno), 0, 0x800);
/* can't use barebox memcpy here, we need 32bit accesses */
- if(xcno == 0) {
+ if (xcno == 0) {
memcpy32((void*)(NETX_PA_XMAC(xcno) + XMAC_RPU_PROGRAM_START), rpu_eth0, sizeof(rpu_eth0));
memcpy32((void*)(NETX_PA_XMAC(xcno) + XMAC_TPU_PROGRAM_START), tpu_eth0, sizeof(tpu_eth0));
memcpy32((void*)NETX_PA_XPEC(xcno) + XPEC_RAM_START, xpec_eth0_mac, sizeof(xpec_eth0_mac));
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/6] netX: use correct sized pointers
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
2012-04-20 13:06 ` [PATCH 1/6] netX: just a style fix Juergen Beisert
@ 2012-04-20 13:06 ` Juergen Beisert
2012-04-20 13:06 ` [PATCH 3/6] netX: adapt it to the current boot spec Juergen Beisert
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
arch/arm/mach-netx/generic.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index e4763c6..f9d643f 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -63,7 +63,7 @@ static int xc_patch(int xcno, void *patch, int count)
static void memset32(void *s, int c, int n)
{
int i;
- unsigned int *t = s;
+ u32 *t = s;
for (i = 0; i < (n >> 2); i++)
*t++ = 0;
@@ -72,8 +72,8 @@ static void memset32(void *s, int c, int n)
static void memcpy32(void *trg, void *src, int size)
{
int i;
- unsigned int *t = trg;
- unsigned int *s = src;
+ u32 *t = trg;
+ u32 *s = src;
for (i = 0; i < (size >> 2); i++)
*t++ = *s++;
}
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/6] netX: adapt it to the current boot spec
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
2012-04-20 13:06 ` [PATCH 1/6] netX: just a style fix Juergen Beisert
2012-04-20 13:06 ` [PATCH 2/6] netX: use correct sized pointers Juergen Beisert
@ 2012-04-20 13:06 ` Juergen Beisert
2012-04-20 13:06 ` [PATCH 4/6] netX: add more common permissions Juergen Beisert
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
scripts/gen_netx_image.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/scripts/gen_netx_image.c b/scripts/gen_netx_image.c
index af279d5..5c2207c 100644
--- a/scripts/gen_netx_image.c
+++ b/scripts/gen_netx_image.c
@@ -9,12 +9,6 @@
#include <libgen.h>
#include <getopt.h>
-#define NETX_IDENTIFICATION 0x5854454E /* Valid signature 'N' 'E' 'T' 'X' */
-
-#define MAGICCOOKIE_8BIT 0xF8BEAF08 /* Cookie used for 8Bit Flashes */
-#define MAGICCOOKIE_16BIT 0xF8BEAF16 /* Cookie used for 16Bit Flashes */
-#define MAGICCOOKIE_32BIT 0xF8BEAF32 /* Cookie used for 32Bit Flashes */
-
struct netx_block_normal {
uint32_t sdram_general_ctrl; /* SDRam General control value */
uint32_t sdram_timing_ctrl; /* SDRam Timing control register value */
@@ -31,6 +25,9 @@ struct netx_block_expbus {
struct netx_bootblock {
uint32_t cookie; /* Cookie identifying bus width and valid bootblock */
+# define MAGICCOOKIE_8BIT 0xF8BEAF08 /* Cookie used for 8Bit Flashes */
+# define MAGICCOOKIE_16BIT 0xF8BEAF16 /* Cookie used for 16Bit Flashes */
+# define MAGICCOOKIE_32BIT 0xF8BEAF32 /* Cookie used for 32Bit Flashes */
union {
uint32_t mem_ctrl; /* Parallel/Serial Flash Mode for setting up timing parameters */
@@ -43,6 +40,7 @@ struct netx_bootblock {
uint32_t appl_size; /* size of application in DWORDs */
uint32_t appl_start_addr; /* Relocation address of application */
uint32_t signature; /* Bootblock signature ('NETX') */
+# define NETX_IDENTIFICATION 0x5854454E /* Valid signature 'N' 'E' 'T' 'X' */
union {
struct netx_block_normal normal;
@@ -50,7 +48,12 @@ struct netx_bootblock {
} config;
uint32_t misc_asic_ctrl; /* ASIC CTRL register value */
- uint32_t reserved[2];
+ uint32_t UserParameter; /* Serial number or user parameter */
+ uint32_t SourceType; /* 1 = parallel falsh at the SRAM bus */
+# define ST_PFLASH 1
+# define ST_SFLASH 2
+# define ST_SEEPROM 3
+
uint32_t boot_checksum; /* Bootblock checksum (complement of DWORD sum over bootblock) */
};
@@ -179,6 +182,7 @@ int main(int argc, char *argv[])
nb->signature = NETX_IDENTIFICATION;
nb->config.normal.sdram_general_ctrl = sdramctrl;
nb->config.normal.sdram_timing_ctrl = sdramtimctrl;
+ nb->SourceType = ST_PFLASH;
ofs = sizeof(struct netx_bootblock);
bytes = barebox_size;
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/6] netX: add more common permissions
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
` (2 preceding siblings ...)
2012-04-20 13:06 ` [PATCH 3/6] netX: adapt it to the current boot spec Juergen Beisert
@ 2012-04-20 13:06 ` Juergen Beisert
2012-04-20 13:06 ` [PATCH 5/6] netX: make the host interface macros compile Juergen Beisert
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
scripts/gen_netx_image.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/gen_netx_image.c b/scripts/gen_netx_image.c
index 5c2207c..18e10bc 100644
--- a/scripts/gen_netx_image.c
+++ b/scripts/gen_netx_image.c
@@ -218,7 +218,8 @@ int main(int argc, char *argv[])
checksum += *ptr++;
nb->boot_checksum = -1 * checksum;
- fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR |
+ S_IRGRP | S_IWGRP | S_IROTH);
if(fd < 0) {
perror("open");
exit(1);
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 5/6] netX: make the host interface macros compile
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
` (3 preceding siblings ...)
2012-04-20 13:06 ` [PATCH 4/6] netX: add more common permissions Juergen Beisert
@ 2012-04-20 13:06 ` Juergen Beisert
2012-04-20 13:06 ` [PATCH 6/6] netX: ignoring temporary netx build tool Juergen Beisert
2012-04-23 5:53 ` [PATCH] some minor fixes for the netX arch Sascha Hauer
6 siblings, 0 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
arch/arm/mach-netx/include/mach/netx-regs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-netx/include/mach/netx-regs.h b/arch/arm/mach-netx/include/mach/netx-regs.h
index c2278cd..27b7b8f 100644
--- a/arch/arm/mach-netx/include/mach/netx-regs.h
+++ b/arch/arm/mach-netx/include/mach/netx-regs.h
@@ -59,7 +59,7 @@
#define NETX_PA_SYSTEM (NETX_IO_PHYS + NETX_OFS_SYSTEM)
#define NETX_PA_MEMCR (NETX_IO_PHYS + NETX_OFS_MEMCR)
-#define NETX_PA_DPRAM (NETX_IO_PHYS + NETX_OFS_DPRAM)
+#define NETX_PA_DPMAS (NETX_IO_PHYS + NETX_OFS_DPRAM)
#define NETX_PA_GPIO (NETX_IO_PHYS + NETX_OFS_GPIO)
#define NETX_PA_PIO (NETX_IO_PHYS + NETX_OFS_PIO)
#define NETX_PA_UART0 (NETX_IO_PHYS + NETX_OFS_UART0)
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 6/6] netX: ignoring temporary netx build tool
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
` (4 preceding siblings ...)
2012-04-20 13:06 ` [PATCH 5/6] netX: make the host interface macros compile Juergen Beisert
@ 2012-04-20 13:06 ` Juergen Beisert
2012-04-23 5:53 ` [PATCH] some minor fixes for the netX arch Sascha Hauer
6 siblings, 0 replies; 8+ messages in thread
From: Juergen Beisert @ 2012-04-20 13:06 UTC (permalink / raw)
To: barebox; +Cc: Michael Trensch
From: Michael Trensch <MTrensch@gmail.com>
Signed-off-by: Michael Trensch <MTrensch@gmail.com>
Acked-by: Juergen Beisert <jbe@pengutronix.de>
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index cc1f2e2..8a5c583 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,3 +62,4 @@ cscope.*
# patches
*.patch
+scripts/gen_netx_image
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] some minor fixes for the netX arch
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
` (5 preceding siblings ...)
2012-04-20 13:06 ` [PATCH 6/6] netX: ignoring temporary netx build tool Juergen Beisert
@ 2012-04-23 5:53 ` Sascha Hauer
6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2012-04-23 5:53 UTC (permalink / raw)
To: Juergen Beisert; +Cc: barebox
On Fri, Apr 20, 2012 at 03:06:11PM +0200, Juergen Beisert wrote:
> Nothing exciting...
Applied, thanks
Sascha
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-04-23 5:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 13:06 [PATCH] some minor fixes for the netX arch Juergen Beisert
2012-04-20 13:06 ` [PATCH 1/6] netX: just a style fix Juergen Beisert
2012-04-20 13:06 ` [PATCH 2/6] netX: use correct sized pointers Juergen Beisert
2012-04-20 13:06 ` [PATCH 3/6] netX: adapt it to the current boot spec Juergen Beisert
2012-04-20 13:06 ` [PATCH 4/6] netX: add more common permissions Juergen Beisert
2012-04-20 13:06 ` [PATCH 5/6] netX: make the host interface macros compile Juergen Beisert
2012-04-20 13:06 ` [PATCH 6/6] netX: ignoring temporary netx build tool Juergen Beisert
2012-04-23 5:53 ` [PATCH] some minor fixes for the netX arch Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox