From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 16 Mar 2016 22:35:55 +0100 Subject: [U-Boot] [PATCH v8 1/9] mips: add base support for QCA/Atheros ath79 SOCs In-Reply-To: References: <1458118800-23675-1-git-send-email-wills.wang@live.com> Message-ID: <56E9D1BB.1070607@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/16/2016 09:59 AM, Wills Wang wrote: > This patch add some common code for QCA/Atheros ath79 SOCs such as > DDR tuning, chip reset and CPU detection. > > Signed-off-by: Wills Wang > --- > > Changes in v8: > - Use setbits_be32 > - Use lookup-table instead of big switch statement for CPU detection > Good stuff, minor nits below. > +++ b/arch/mips/mach-ath79/cpu.c > @@ -0,0 +1,142 @@ > +/* > + * Copyright (C) 2015-2016 Wills Wang > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +struct ath79_soc_desc { > + enum ath79_soc_type soc; > + const char *chip; > + int major; > + int minor; All of this stuff can be const, no ? > +}; [...] > diff --git a/arch/mips/mach-ath79/dram.c b/arch/mips/mach-ath79/dram.c > new file mode 100644 > index 0000000..c29e98c > --- /dev/null > +++ b/arch/mips/mach-ath79/dram.c > @@ -0,0 +1,16 @@ > +/* > + * Copyright (C) 2015-2016 Wills Wang > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > + > +phys_size_t initdram(int board_type) > +{ > + ddr_tap_tuning(); Is the DDR tap tuning needed on all AR7xxx/AR9xxx systems ? > + return get_ram_size((void *)KSEG1, SZ_256M); > +} > diff --git a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h > new file mode 100644 > index 0000000..893dedc > --- /dev/null > +++ b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h > @@ -0,0 +1,1184 @@ > +/* > + * Atheros AR71XX/AR724X/AR913X SoC register definitions > + * > + * Copyright (C) 2015-2016 Wills Wang > + * Copyright (C) 2010-2011 Jaiganesh Narayanan > + * Copyright (C) 2008-2010 Gabor Juhos > + * Copyright (C) 2008 Imre Kaloz > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#ifndef __ASM_MACH_AR71XX_REGS_H > +#define __ASM_MACH_AR71XX_REGS_H > + > +#ifndef __ASSEMBLY__ > +#include > +#else > +#ifndef BIT > +#define BIT(nr) (1 << (nr)) This should really go into some common header. > +#endif > +#endif > + > +#define AR71XX_APB_BASE 0x18000000 > +#define AR71XX_GE0_BASE 0x19000000 > +#define AR71XX_GE0_SIZE 0x10000 > +#define AR71XX_GE1_BASE 0x1a000000 > +#define AR71XX_GE1_SIZE 0x10000 > +#define AR71XX_EHCI_BASE 0x1b000000 > +#define AR71XX_EHCI_SIZE 0x1000 > +#define AR71XX_OHCI_BASE 0x1c000000 > +#define AR71XX_OHCI_SIZE 0x1000 > +#define AR71XX_SPI_BASE 0x1f000000 > +#define AR71XX_SPI_SIZE 0x01000000 Indent the macro value with tabs in this file please. [...] -- Best regards, Marek Vasut