summaryrefslogtreecommitdiff
path: root/arch/nds32
diff options
context:
space:
mode:
Diffstat (limited to 'arch/nds32')
-rw-r--r--arch/nds32/cpu/n1213/ag101/cpu.c8
-rw-r--r--arch/nds32/cpu/n1213/ag101/timer.c8
-rw-r--r--arch/nds32/cpu/n1213/u-boot.lds2
-rw-r--r--arch/nds32/include/asm/io.h18
-rw-r--r--arch/nds32/include/asm/mach-types.h14
-rw-r--r--arch/nds32/lib/board.c5
6 files changed, 44 insertions, 11 deletions
diff --git a/arch/nds32/cpu/n1213/ag101/cpu.c b/arch/nds32/cpu/n1213/ag101/cpu.c
index 0ab666e8d..c2636b121 100644
--- a/arch/nds32/cpu/n1213/ag101/cpu.c
+++ b/arch/nds32/cpu/n1213/ag101/cpu.c
@@ -45,10 +45,6 @@
*/
int cleanup_before_linux(void)
{
-#ifdef CONFIG_MMU
- unsigned long i;
-#endif
-
disable_interrupts();
#ifdef CONFIG_MMU
@@ -123,8 +119,8 @@ void icache_inval_range(unsigned long start, unsigned long end)
void flush_cache(unsigned long addr, unsigned long size)
{
- dcache_flush_range(addr , addr + size);
- icache_inval_range(addr , addr + size);
+ dcache_flush_range(addr, addr + size);
+ icache_inval_range(addr, addr + size);
}
void icache_enable(void)
diff --git a/arch/nds32/cpu/n1213/ag101/timer.c b/arch/nds32/cpu/n1213/ag101/timer.c
index c099c33ac..caa36b8be 100644
--- a/arch/nds32/cpu/n1213/ag101/timer.c
+++ b/arch/nds32/cpu/n1213/ag101/timer.c
@@ -33,7 +33,7 @@ static ulong lastdec;
int timer_init(void)
{
- static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
+ struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
unsigned int cr;
debug("%s()\n", __func__);
@@ -80,7 +80,7 @@ int timer_init(void)
*/
void reset_timer_masked(void)
{
- static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
+ struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
/* capure current decrementer value time */
#ifdef CONFIG_FTTMR010_EXT_CLK
@@ -104,7 +104,7 @@ void reset_timer(void)
*/
ulong get_timer_masked(void)
{
- static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
+ struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
/* current tick value */
#ifdef CONFIG_FTTMR010_EXT_CLK
@@ -160,7 +160,7 @@ void set_timer(ulong t)
/* delay x useconds AND preserve advance timestamp value */
void __udelay(unsigned long usec)
{
- static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
+ struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
#ifdef CONFIG_FTTMR010_EXT_CLK
long tmo = usec * (TIMER_CLOCK / 1000) / 1000;
diff --git a/arch/nds32/cpu/n1213/u-boot.lds b/arch/nds32/cpu/n1213/u-boot.lds
index 45221ee78..190342062 100644
--- a/arch/nds32/cpu/n1213/u-boot.lds
+++ b/arch/nds32/cpu/n1213/u-boot.lds
@@ -41,7 +41,7 @@ SECTIONS
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
. = ALIGN(4);
- .data : { *(.data) }
+ .data : { *(.data*) }
. = ALIGN(4);
diff --git a/arch/nds32/include/asm/io.h b/arch/nds32/include/asm/io.h
index 2c105f7fa..39c3dc8d9 100644
--- a/arch/nds32/include/asm/io.h
+++ b/arch/nds32/include/asm/io.h
@@ -165,6 +165,24 @@ static inline unsigned int readl(unsigned int *addr)
#define __raw_base_readw(base, off) __arch_base_getw(base, off)
#define __raw_base_readl(base, off) __arch_base_getl(base, off)
+#define out_arch(type, endian, a, v) __raw_write##type(cpu_to_##endian(v), a)
+#define in_arch(type, endian, a) endian##_to_cpu(__raw_read##type(a))
+
+#define out_le32(a, v) out_arch(l, le32, a, v)
+#define out_le16(a, v) out_arch(w, le16, a, v)
+
+#define in_le32(a) in_arch(l, le32, a)
+#define in_le16(a) in_arch(w, le16, a)
+
+#define out_be32(a, v) out_arch(l, be32, a, v)
+#define out_be16(a, v) out_arch(w, be16, a, v)
+
+#define in_be32(a) in_arch(l, be32, a)
+#define in_be16(a) in_arch(w, be16, a)
+
+#define out_8(a, v) __raw_writeb(v, a)
+#define in_8(a) __raw_readb(a)
+
/*
* Now, pick up the machine-defined IO definitions
* #include <asm/arch/io.h>
diff --git a/arch/nds32/include/asm/mach-types.h b/arch/nds32/include/asm/mach-types.h
index a6f1c9349..7b52b989b 100644
--- a/arch/nds32/include/asm/mach-types.h
+++ b/arch/nds32/include/asm/mach-types.h
@@ -26,4 +26,18 @@ extern unsigned int __machine_arch_type;
# define machine_is_adpag101() (0)
#endif
+#define MACH_TYPE_ADPAG101P 1
+
+#ifdef CONFIG_ARCH_ADPAG101P
+# ifdef machine_arch_type
+# undef machine_arch_type
+# define machine_arch_type __machine_arch_type
+# else
+# define machine_arch_type MACH_TYPE_ADPAG101P
+# endif
+# define machine_is_adpag101p() (machine_arch_type == MACH_TYPE_ADPAG101P)
+#else
+# define machine_is_adpag101p() (1)
+#endif
+
#endif /* __ASM_NDS32_MACH_TYPE_H */
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 2fd0e93d4..66e45370c 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -351,6 +351,11 @@ void board_init_r(gd_t *id, ulong dest_addr)
nand_init(); /* go init the NAND */
#endif
+#if defined(CONFIG_CMD_IDE)
+ puts("IDE: ");
+ ide_init();
+#endif
+
#ifdef CONFIG_GENERIC_MMC
puts("MMC: ");
mmc_initialize(gd->bd);