Commit a752a8b4c49d67daa4ea9f9ebac3972bb1c2328b
1 parent
c722f0b026
Exists in
v2017.01-smarct4x
and in
37 other branches
avr32: add generic board support
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Showing 10 changed files with 37 additions and 6 deletions Side-by-side Diff
arch/avr32/config.mk
arch/avr32/cpu/u-boot.lds
arch/avr32/include/asm/config.h
arch/avr32/include/asm/u-boot.h
... | ... | @@ -6,6 +6,11 @@ |
6 | 6 | #ifndef __ASM_U_BOOT_H__ |
7 | 7 | #define __ASM_U_BOOT_H__ 1 |
8 | 8 | |
9 | +#ifdef CONFIG_SYS_GENERIC_BOARD | |
10 | +/* Use the generic board which requires a unified bd_info */ | |
11 | +#include <asm-generic/u-boot.h> | |
12 | +#else | |
13 | + | |
9 | 14 | typedef struct bd_info { |
10 | 15 | unsigned char bi_phy_id[4]; |
11 | 16 | unsigned long bi_board_number; |
... | ... | @@ -21,6 +26,8 @@ |
21 | 26 | |
22 | 27 | #define bi_memstart bi_dram[0].start |
23 | 28 | #define bi_memsize bi_dram[0].size |
29 | + | |
30 | +#endif | |
24 | 31 | |
25 | 32 | /* For image.h:image_check_target_arch() */ |
26 | 33 | #define IH_ARCH_DEFAULT IH_ARCH_AVR32 |
arch/avr32/lib/Makefile
arch/avr32/lib/interrupts.c
common/board_f.c
... | ... | @@ -883,7 +883,7 @@ |
883 | 883 | #endif |
884 | 884 | announce_dram_init, |
885 | 885 | /* TODO: unify all these dram functions? */ |
886 | -#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) | |
886 | +#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) | |
887 | 887 | dram_init, /* configure available RAM banks */ |
888 | 888 | #endif |
889 | 889 | #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) |
common/board_r.c
... | ... | @@ -55,6 +55,9 @@ |
55 | 55 | #include <dm/root.h> |
56 | 56 | #include <linux/compiler.h> |
57 | 57 | #include <linux/err.h> |
58 | +#ifdef CONFIG_AVR32 | |
59 | +#include <asm/arch/mmu.h> | |
60 | +#endif | |
58 | 61 | |
59 | 62 | DECLARE_GLOBAL_DATA_PTR; |
60 | 63 | |
... | ... | @@ -498,7 +501,7 @@ |
498 | 501 | #endif |
499 | 502 | |
500 | 503 | /* enable exceptions */ |
501 | -#ifdef CONFIG_ARM | |
504 | +#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) | |
502 | 505 | static int initr_enable_interrupts(void) |
503 | 506 | { |
504 | 507 | enable_interrupts(); |
505 | 508 | |
... | ... | @@ -825,10 +828,10 @@ |
825 | 828 | initr_kgdb, |
826 | 829 | #endif |
827 | 830 | interrupt_init, |
828 | -#if defined(CONFIG_ARM) | |
831 | +#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) | |
829 | 832 | initr_enable_interrupts, |
830 | 833 | #endif |
831 | -#if defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) | |
834 | +#if defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) | |
832 | 835 | timer_init, /* initialize timer */ |
833 | 836 | #endif |
834 | 837 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) |
... | ... | @@ -891,6 +894,10 @@ |
891 | 894 | { |
892 | 895 | #ifdef CONFIG_NEEDS_MANUAL_RELOC |
893 | 896 | int i; |
897 | +#endif | |
898 | + | |
899 | +#ifdef CONFIG_AVR32 | |
900 | + mmu_init_r(dest_addr); | |
894 | 901 | #endif |
895 | 902 | |
896 | 903 | #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) |
common/cmd_bdinfo.c
... | ... | @@ -345,8 +345,8 @@ |
345 | 345 | bd_t *bd = gd->bd; |
346 | 346 | |
347 | 347 | print_num("boot_params", (ulong)bd->bi_boot_params); |
348 | - print_num("memstart", (ulong)bd->bi_memstart); | |
349 | - print_lnum("memsize", (u64)bd->bi_memsize); | |
348 | + print_num("memstart", (ulong)bd->bi_dram[0].start); | |
349 | + print_lnum("memsize", (u64)bd->bi_dram[0].size); | |
350 | 350 | print_num("flashstart", (ulong)bd->bi_flashstart); |
351 | 351 | print_num("flashsize", (ulong)bd->bi_flashsize); |
352 | 352 | print_num("flashoffset", (ulong)bd->bi_flashoffset); |
include/asm-generic/u-boot.h
... | ... | @@ -32,6 +32,10 @@ |
32 | 32 | unsigned long bi_flashoffset; /* reserved area for startup monitor */ |
33 | 33 | unsigned long bi_sramstart; /* start of SRAM memory */ |
34 | 34 | unsigned long bi_sramsize; /* size of SRAM memory */ |
35 | +#ifdef CONFIG_AVR32 | |
36 | + unsigned char bi_phy_id[4]; /* PHY address for ATAG_ETHERNET */ | |
37 | + unsigned long bi_board_number;/* ATAG_BOARDINFO */ | |
38 | +#endif | |
35 | 39 | #ifdef CONFIG_ARM |
36 | 40 | unsigned long bi_arm_freq; /* arm frequency */ |
37 | 41 | unsigned long bi_dsp_freq; /* dsp core frequency */ |