[U-Boot] [PATCH] mips: add base support for atheros ar71xx based SOCs

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Sat Dec 19 22:57:52 CET 2015



Am 18.12.2015 um 08:34 schrieb Wills Wang:
> This patch enable work for ar933x SOC, tested on ar9331
> 
> Signed-off-by: Wills Wang <wills.wang at live.com>
> ---
> 
>  arch/mips/Makefile                          |    1 +
>  arch/mips/include/asm/ar71xx.h              | 1144 +++++++++++++++++++++++++++
>  arch/mips/mach-ath79/Makefile               |    8 +
>  arch/mips/mach-ath79/ar933x/Makefile        |   11 +
>  arch/mips/mach-ath79/ar933x/dram.c          |   27 +
>  arch/mips/mach-ath79/ar933x/lowlevel_init.S |  784 ++++++++++++++++++
>  arch/mips/mach-ath79/ar933x/reset.c         |   29 +
>  arch/mips/mach-ath79/ar933x/serial.c        |  348 ++++++++
>  arch/mips/mach-ath79/config.mk              |    8 +
>  9 files changed, 2360 insertions(+)
>  create mode 100644 arch/mips/include/asm/ar71xx.h
>  create mode 100644 arch/mips/mach-ath79/Makefile
>  create mode 100644 arch/mips/mach-ath79/ar933x/Makefile
>  create mode 100644 arch/mips/mach-ath79/ar933x/dram.c
>  create mode 100644 arch/mips/mach-ath79/ar933x/lowlevel_init.S
>  create mode 100644 arch/mips/mach-ath79/ar933x/reset.c
>  create mode 100644 arch/mips/mach-ath79/ar933x/serial.c
>  create mode 100644 arch/mips/mach-ath79/config.mk
> 

We are transitioning towards "Driver Model" and new code should already
support it where possible. Thus rewrite at least serial.c as DM
compatible driver in drivers/serial/. If possible you should also
support device-tree. The next branch in u-boot-mips tree has a patch
which adds the initial infrastructure for it on MIPS.

Put all SoC specific header files in arch/mips/include/asm/arch-ath79/.
The next branch in u-boot-mips tree already has a patch to support again
the creation of symbolic links arch/mips/include/asm/arch ->
arch/mips/include/asm/arch-SOC. Apart from that your directory structure
is fine.

Add proper Kconfig symbols for your SoC. Also you need to have at least
one board that uses your SoC. That board have to be created in board/
directory along with proper Kconfig and MAINTAINERS files. Additionally
you need to add a Kconfig defconfig file for your board in directory
configs/. I wonder how you got your code compiled without a possibility
to select it with Kconfig.

Try to minimize the code in lowlevel_init.S. It is only intended to
bring up memory controllers and DRAM and maybe some clocks before a C
environment is available. Other code should be always written in C.
If your SoC has some SRAM space, you could use that for the initial
stack and global data and drop lowlevel_init.S entirely.

Please create at least three patches in your next patch series:
1) add ar933x SoC
2) add serial driver for ar933x (or one for all ath79 compatible SoC's)
3) add one ar933x based board (e.g. an official evaluation kit)

-- 
- Daniel


More information about the U-Boot mailing list