* [PATCH 1/5] [Nios2]: Update generic env/config
2011-05-15 19:34 [PATCH 0/5] [Nios2]: Differents fixes franck.jullien
@ 2011-05-15 19:34 ` franck.jullien
2011-05-15 19:34 ` [PATCH 2/5] [Nios2]: Fix typo in generic.c franck.jullien
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: franck.jullien @ 2011-05-15 19:34 UTC (permalink / raw)
To: barebox
From: Franck JULLIEN <franck.jullien@gmail.com>
This adds kernel_loc, kernelimage_type and bootargs to the
generic board environment. This allows the generic board
to boot linux on the example I'll provide on my website.
Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
---
arch/nios2/boards/generic/env/config | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/nios2/boards/generic/env/config b/arch/nios2/boards/generic/env/config
index df7d09e..5d23098 100644
--- a/arch/nios2/boards/generic/env/config
+++ b/arch/nios2/boards/generic/env/config
@@ -4,6 +4,9 @@
kernel=flash
root=flash
+kernel_loc=nor
+kernelimage_type=uimage
+
# use 'dhcp' todo dhcp in barebox and in kernel
ip=none
@@ -11,6 +14,8 @@ autoboot_timeout=3
nor_parts="256k(barebox),128k(env),4M(kernel),-(rootfs)"
+bootargs="console=ttyS0,9600"
+
# set a fancy prompt (if support is compiled in)
PS1="\e[1;33mbarebox@\e[1;32mgeneric:\w\e[0m "
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/5] [Nios2]: Fix typo in generic.c
2011-05-15 19:34 [PATCH 0/5] [Nios2]: Differents fixes franck.jullien
2011-05-15 19:34 ` [PATCH 1/5] [Nios2]: Update generic env/config franck.jullien
@ 2011-05-15 19:34 ` franck.jullien
2011-05-15 19:34 ` [PATCH 3/5] [Nios2]: Change system frequency in generic board franck.jullien
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: franck.jullien @ 2011-05-15 19:34 UTC (permalink / raw)
To: barebox
From: Franck JULLIEN <franck.jullien@gmail.com>
The device init function has the name of one of my board (comBoard).
This patch fix the name of the function to generic_device_init.
Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
---
arch/nios2/boards/generic/generic.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 7e939ce..4f7e747 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -48,7 +48,7 @@ static struct device_d epcs_flash_device = {
};
*/
-static int comBoard_devices_init(void)
+static int generic_devices_init(void)
{
register_device(&cfi_dev);
register_device(&ram_dev);
@@ -63,7 +63,7 @@ static int comBoard_devices_init(void)
return 0;
}
-device_initcall(comBoard_devices_init);
+device_initcall(generic_devices_init);
static int altera_console_init(void)
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/5] [Nios2]: Change system frequency in generic board
2011-05-15 19:34 [PATCH 0/5] [Nios2]: Differents fixes franck.jullien
2011-05-15 19:34 ` [PATCH 1/5] [Nios2]: Update generic env/config franck.jullien
2011-05-15 19:34 ` [PATCH 2/5] [Nios2]: Fix typo in generic.c franck.jullien
@ 2011-05-15 19:34 ` franck.jullien
2011-05-15 19:34 ` [PATCH 4/5] [Nios2]: Fix compiler warning franck.jullien
2011-05-15 19:34 ` [PATCH 5/5] [Nios2]: Fix dma mapping end address franck.jullien
4 siblings, 0 replies; 6+ messages in thread
From: franck.jullien @ 2011-05-15 19:34 UTC (permalink / raw)
To: barebox
From: Franck JULLIEN <franck.jullien@gmail.com>
In order to match the example I'll provide on my website,
set the system frequency to 100MHz in the generic board
nios_sopc.h
Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
---
arch/nios2/boards/generic/nios_sopc.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/nios2/boards/generic/nios_sopc.h b/arch/nios2/boards/generic/nios_sopc.h
index 5ee3642..688bc44 100644
--- a/arch/nios2/boards/generic/nios_sopc.h
+++ b/arch/nios2/boards/generic/nios_sopc.h
@@ -28,7 +28,7 @@
*/
#define CPU_IMPLEMENTATION "fast"
#define BIG_ENDIAN 0
-#define CPU_FREQ 50000000
+#define CPU_FREQ 100000000
#define ICACHE_LINE_SIZE 32
#define ICACHE_LINE_SIZE_LOG2 5
#define ICACHE_SIZE 8192
@@ -221,7 +221,7 @@
#define SGDMA_TX_BASE 0x4204400
#define SGDMA_TX_SPAN 64
#define SGDMA_TX_END 0x420443f
-#define SGDMA_TX_IRQ 0
+#define SGDMA_TX_IRQ 5
#define SGDMA_TX_READ_BLOCK_DATA_WIDTH 32
#define SGDMA_TX_WRITE_BLOCK_DATA_WIDTH 32
#define SGDMA_TX_STREAM_DATA_WIDTH 32
@@ -336,7 +336,7 @@
#define UART_USE_EOP_REGISTER 0
#define UART_SIM_TRUE_BAUD 0
#define UART_SIM_CHAR_STREAM ""
-#define UART_FREQ 50000000
+#define UART_FREQ 100000000
/*
* Macros for device 'SYS_CLK_TIMER', class 'altera_avalon_timer'
@@ -356,8 +356,8 @@
#define SYS_CLK_TIMER_PERIOD_UNITS "ms"
#define SYS_CLK_TIMER_RESET_OUTPUT 0
#define SYS_CLK_TIMER_TIMEOUT_PULSE_OUTPUT 0
-#define SYS_CLK_TIMER_FREQ 50000000
-#define SYS_CLK_TIMER_LOAD_VALUE 49999ULL
+#define SYS_CLK_TIMER_FREQ 100000000
+#define SYS_CLK_TIMER_LOAD_VALUE 99999ULL
#define SYS_CLK_TIMER_COUNTER_SIZE 32
#define SYS_CLK_TIMER_MULT 0.0010
#define SYS_CLK_TIMER_TICKS_PER_SEC 1000
@@ -384,7 +384,7 @@
#define LED_STATUS_RESET_VALUE 0x3
#define LED_STATUS_EDGE_TYPE "NONE"
#define LED_STATUS_IRQ_TYPE "NONE"
-#define LED_STATUS_FREQ 50000000
+#define LED_STATUS_FREQ 100000000
/*
* Macros for device 'JTAG_UART', class 'altera_avalon_jtag_uart'
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/5] [Nios2]: Fix compiler warning
2011-05-15 19:34 [PATCH 0/5] [Nios2]: Differents fixes franck.jullien
` (2 preceding siblings ...)
2011-05-15 19:34 ` [PATCH 3/5] [Nios2]: Change system frequency in generic board franck.jullien
@ 2011-05-15 19:34 ` franck.jullien
2011-05-15 19:34 ` [PATCH 5/5] [Nios2]: Fix dma mapping end address franck.jullien
4 siblings, 0 replies; 6+ messages in thread
From: franck.jullien @ 2011-05-15 19:34 UTC (permalink / raw)
To: barebox
From: Franck JULLIEN <franck.jullien@gmail.com>
Fix incompatible pointer type warning.
Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
---
drivers/net/altera_tse.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index d922a9a..ac8cd2d 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -526,7 +526,7 @@ static int tse_probe(struct device_d *dev)
tx_desc = (struct alt_sgdma_descriptor *)NIOS_SOPC_TSE_DESC_MEM_BASE;
rx_desc = tx_desc + 2;
#else
- tx_desc = dma_alloc_coherent(sizeof(*tx_desc) * (3 + PKTBUFSRX), &dma_handle);
+ tx_desc = dma_alloc_coherent(sizeof(*tx_desc) * (3 + PKTBUFSRX), (unsigned long *)&dma_handle);
rx_desc = tx_desc + 2;
if (!tx_desc) {
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/5] [Nios2]: Fix dma mapping end address
2011-05-15 19:34 [PATCH 0/5] [Nios2]: Differents fixes franck.jullien
` (3 preceding siblings ...)
2011-05-15 19:34 ` [PATCH 4/5] [Nios2]: Fix compiler warning franck.jullien
@ 2011-05-15 19:34 ` franck.jullien
4 siblings, 0 replies; 6+ messages in thread
From: franck.jullien @ 2011-05-15 19:34 UTC (permalink / raw)
To: barebox
From: Franck JULLIEN <franck.jullien@gmail.com>
The flush_dcache_range function takes an absolute end address
so we have to add start address to the second parameter.
Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
---
arch/nios2/include/asm/dma-mapping.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h
index 49ebf79..5b70f4c 100644
--- a/arch/nios2/include/asm/dma-mapping.h
+++ b/arch/nios2/include/asm/dma-mapping.h
@@ -15,7 +15,7 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
void *addr = malloc(len + DCACHE_LINE_SIZE);
if (!addr)
return 0;
- flush_dcache_range((unsigned long)addr, len + DCACHE_LINE_SIZE);
+ flush_dcache_range((unsigned long)addr,(unsigned long)addr + len + DCACHE_LINE_SIZE);
*handle = ((unsigned long)addr +
(DCACHE_LINE_SIZE - 1)) &
~(DCACHE_LINE_SIZE - 1) & ~(IO_REGION_BASE);
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread