Skip to contentSkip to conversation

mips: add initial support for qca956x referenced board

PATCH New rosysong at rosinson.com 2 participants 2 messages Mar 7, 2019 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH v3 2/3 mips: add initial support for qca956x referenced board

From: Rosy Song <[email protected]>

QCA9563 is CPU used on AP152 board :

Clock speed : 750 MHz ,
Arch : Mips 74Kc,
Eth : SGMII interface,
MIMO config : 3 * 3 450M,
2 * USB 2.0,

Changes for v2:
- coding Style cleanup
- remove ununsed flash chip in defconfig
- enable automatic icache / dcache size in defconfig

Changes for v3:
- add detailed information for qca956x in commit message

---
 arch/mips/dts/Makefile                        |   1 +
 arch/mips/dts/ap152.dts                       |  48 ++
 arch/mips/dts/qca956x.dtsi                    |  87 ++++
 arch/mips/mach-ath79/Kconfig                  |  14 +
 arch/mips/mach-ath79/Makefile                 |   1 +
 .../mach-ath79/include/mach/ar71xx_regs.h     |  73 +++
 arch/mips/mach-ath79/include/mach/ath79.h     |   3 +
 arch/mips/mach-ath79/qca956x/Makefile         |   5 +
 arch/mips/mach-ath79/qca956x/clk.c            | 419 ++++++++++++++++++
 arch/mips/mach-ath79/qca956x/cpu.c            |   9 +
 arch/mips/mach-ath79/qca956x/ddr.c            | 308 +++++++++++++
 .../mips/mach-ath79/qca956x/qca956x-ddr-tap.S | 193 ++++++++
 arch/mips/mach-ath79/reset.c                  | 271 +++++++++++
 board/qca/ap152/Kconfig                       |  15 +
 board/qca/ap152/MAINTAINERS                   |   6 +
 board/qca/ap152/Makefile                      |   3 +
 board/qca/ap152/ap152.c                       |  81 ++++
 configs/ap152_defconfig                       |  49 ++
 include/configs/ap152.h                       |  54 +++
 19 files changed, 1640 insertions(+)
 create mode 100644 arch/mips/dts/ap152.dts
 create mode 100644 arch/mips/dts/qca956x.dtsi
 create mode 100644 arch/mips/mach-ath79/qca956x/Makefile
 create mode 100644 arch/mips/mach-ath79/qca956x/clk.c
 create mode 100644 arch/mips/mach-ath79/qca956x/cpu.c
 create mode 100644 arch/mips/mach-ath79/qca956x/ddr.c
 create mode 100644 arch/mips/mach-ath79/qca956x/qca956x-ddr-tap.S
 create mode 100644 board/qca/ap152/Kconfig
 create mode 100644 board/qca/ap152/MAINTAINERS
 create mode 100644 board/qca/ap152/Makefile
 create mode 100644 board/qca/ap152/ap152.c
 create mode 100644 configs/ap152_defconfig
 create mode 100644 include/configs/ap152.h
arch/mips/dts/Makefile +1 -0
index b94b582837..621c35f0ef 100644
@@ -2,6 +2,7 @@
 
 dtb-$(CONFIG_TARGET_AP121) += ap121.dtb
 dtb-$(CONFIG_TARGET_AP143) += ap143.dtb
+dtb-$(CONFIG_TARGET_AP152) += ap152.dtb
 dtb-$(CONFIG_TARGET_BOSTON) += img,boston.dtb
 dtb-$(CONFIG_TARGET_MALTA) += mti,malta.dtb
 dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb
arch/mips/dts/ap152.dts new file +48 -0

48 lines not on this page · raw message

arch/mips/dts/qca956x.dtsi new file +87 -0

87 lines not on this page · raw message

arch/mips/mach-ath79/Kconfig +14 -0
index bc86f591df..bdb23b5765 100644
@@ -33,6 +33,15 @@ config SOC_QCA953X
 	help
 	  This supports QCA/Atheros qca953x family SOCs.
 
+config SOC_QCA956X
+	bool
+	select MIPS_TUNE_74KC
+	select SUPPORTS_BIG_ENDIAN
+	select SUPPORTS_CPU_MIPS32_R1
+	select SUPPORTS_CPU_MIPS32_R2
+	help
+	  This supports QCA/Atheros qca956x family SOCs.
+
 choice
 	prompt "Board select"
 
@@ -44,6 +53,10 @@ config TARGET_AP143
 	bool "AP143 Reference Board"
 	select SOC_QCA953X
 
+config TARGET_AP152
+	bool "AP152 Reference Board"
+	select SOC_QCA956X
+
 config BOARD_TPLINK_WDR4300
 	bool "TP-Link WDR4300 Board"
 	select SOC_AR934X
@@ -52,6 +65,7 @@ endchoice
 
 source "board/qca/ap121/Kconfig"
 source "board/qca/ap143/Kconfig"
+source "board/qca/ap152/Kconfig"
 source "board/tplink/wdr4300/Kconfig"
 
 endmenu
arch/mips/mach-ath79/Makefile +1 -0
index 7aa40c65d3..fbd40c02be 100644
@@ -7,3 +7,4 @@ obj-y += dram.o
 obj-$(CONFIG_SOC_AR933X)	+= ar933x/
 obj-$(CONFIG_SOC_AR934X)	+= ar934x/
 obj-$(CONFIG_SOC_QCA953X)	+= qca953x/
+obj-$(CONFIG_SOC_QCA956X)	+= qca956x/
arch/mips/mach-ath79/include/mach/ar71xx_regs.h +73 -0

121 lines not on this page · raw message

arch/mips/mach-ath79/include/mach/ath79.h +3 -0
index 5de7a43f79..0fde5079b1 100644
@@ -2,6 +2,7 @@
 /*
  * Atheros AR71XX/AR724X/AR913X common definitions
  *
+ * Copyright (C) 2018-2019 Rosy Song <[email protected]>
  * Copyright (C) 2015-2016 Wills Wang <[email protected]>
  * Copyright (C) 2008-2011 Gabor Juhos <[email protected]>
  * Copyright (C) 2008 Imre Kaloz <[email protected]>
@@ -146,4 +147,6 @@ int ath79_usb_reset(void);
 void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
 void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
 
+void qca956x_pll_init(void);
+void qca956x_ddr_init(void);
 #endif /* __ASM_MACH_ATH79_H */
arch/mips/mach-ath79/qca956x/Makefile new file +5 -0
new file mode 100644
index 0000000000..3f5fc0363f
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += cpu.o
+obj-y += clk.o
+obj-y += ddr.o qca956x-ddr-tap.o
arch/mips/mach-ath79/qca956x/clk.c new file +419 -0

419 lines not on this page · raw message

arch/mips/mach-ath79/qca956x/cpu.c new file +9 -0
new file mode 100644
index 0000000000..08a8c84e72
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Rosy Song <[email protected]>
+ */
+
+#include <common.h>
+
+/* The lowlevel_init() is not needed on QCA956X */
+void lowlevel_init(void) {}
arch/mips/mach-ath79/qca956x/ddr.c new file +308 -0

308 lines not on this page · raw message

arch/mips/mach-ath79/qca956x/qca956x-ddr-tap.S new file +193 -0

193 lines not on this page · raw message

arch/mips/mach-ath79/reset.c +271 -0

295 lines not on this page · raw message

board/qca/ap152/Kconfig new file +15 -0
new file mode 100644
index 0000000000..f6ad498e85
@@ -0,0 +1,15 @@
+if TARGET_AP152
+
+config SYS_VENDOR
+	default "qca"
+
+config SYS_BOARD
+	default "ap152"
+
+config SYS_CONFIG_NAME
+	default "ap152"
+
+config SYS_TEXT_BASE
+	default 0x9f000000
+
+endif
board/qca/ap152/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..785ec2766d
@@ -0,0 +1,6 @@
+AP152 BOARD
+M:	Rosy Song <[email protected]>
+S:	Maintained
+F:	board/qca/ap152/
+F:	include/configs/ap152.h
+F:	configs/ap152_defconfig
board/qca/ap152/Makefile new file +3 -0
new file mode 100644
index 0000000000..4270afa129
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y	= ap152.o
board/qca/ap152/ap152.c new file +81 -0

81 lines not on this page · raw message

configs/ap152_defconfig new file +49 -0

49 lines not on this page · raw message

include/configs/ap152.h new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 2/3 mips: add initial support for qca956x referenced board

Am Do., 7. März 2019 um 02:31 Uhr schrieb <[email protected]>:

Quoted 46 lines

From: Rosy Song <[email protected]>

QCA9563 is CPU used on AP152 board :

Clock speed : 750 MHz ,
Arch : Mips 74Kc,
Eth : SGMII interface,
MIMO config : 3 * 3 450M,
2 * USB 2.0,

Changes for v2:
- coding Style cleanup
- remove ununsed flash chip in defconfig
- enable automatic icache / dcache size in defconfig

Changes for v3:
- add detailed information for qca956x in commit message

---
 arch/mips/dts/Makefile                        |   1 +
 arch/mips/dts/ap152.dts                       |  48 ++
 arch/mips/dts/qca956x.dtsi                    |  87 ++++
 arch/mips/mach-ath79/Kconfig                  |  14 +
 arch/mips/mach-ath79/Makefile                 |   1 +
 .../mach-ath79/include/mach/ar71xx_regs.h     |  73 +++
 arch/mips/mach-ath79/include/mach/ath79.h     |   3 +
 arch/mips/mach-ath79/qca956x/Makefile         |   5 +
 arch/mips/mach-ath79/qca956x/clk.c            | 419 ++++++++++++++++++
 arch/mips/mach-ath79/qca956x/cpu.c            |   9 +
 arch/mips/mach-ath79/qca956x/ddr.c            | 308 +++++++++++++
 .../mips/mach-ath79/qca956x/qca956x-ddr-tap.S | 193 ++++++++
 arch/mips/mach-ath79/reset.c                  | 271 +++++++++++
 board/qca/ap152/Kconfig                       |  15 +
 board/qca/ap152/MAINTAINERS                   |   6 +
 board/qca/ap152/Makefile                      |   3 +
 board/qca/ap152/ap152.c                       |  81 ++++
 configs/ap152_defconfig                       |  49 ++
 include/configs/ap152.h                       |  54 +++
 19 files changed, 1640 insertions(+)
 create mode 100644 arch/mips/dts/ap152.dts
 create mode 100644 arch/mips/dts/qca956x.dtsi
 create mode 100644 arch/mips/mach-ath79/qca956x/Makefile
 create mode 100644 arch/mips/mach-ath79/qca956x/clk.c
 create mode 100644 arch/mips/mach-ath79/qca956x/cpu.c
Quoted 9 lines
 create mode 100644 arch/mips/mach-ath79/qca956x/ddr.c
 create mode 100644 arch/mips/mach-ath79/qca956x/qca956x-ddr-tap.S
 create mode 100644 board/qca/ap152/Kconfig
 create mode 100644 board/qca/ap152/MAINTAINERS
 create mode 100644 board/qca/ap152/Makefile
 create mode 100644 board/qca/ap152/ap152.c
 create mode 100644 configs/ap152_defconfig
 create mode 100644 include/configs/ap152.h

(if the following comment is addressed)

...

Quoted 35 lines
include/configs/ap152.h new file +29 -0
new file mode 100644
index 0000000000..bc88506dff
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018 Rosy Song <[email protected]>
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_SYS_HZ                   1000
+#define CONFIG_SYS_MHZ                  375
+#define CONFIG_SYS_MIPS_TIMER_FREQ      (CONFIG_SYS_MHZ * 1000000)
+
+#define CONFIG_SYS_MONITOR_BASE         CONFIG_SYS_TEXT_BASE
+
+#define CONFIG_SYS_MALLOC_LEN           0x40000
+#define CONFIG_SYS_BOOTPARAMS_LEN       0x20000
+
+#define CONFIG_SYS_SDRAM_BASE           0x80000000
+#define CONFIG_SYS_LOAD_ADDR            0x81000000
+
+#define CONFIG_SYS_INIT_RAM_ADDR        0xbd000000
+#define CONFIG_SYS_INIT_RAM_SIZE        0x2000
+#define CONFIG_SYS_INIT_SP_ADDR \
+       (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE - 1)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_CLK          25000000

include/configs/ap152.h line 39

Quoted 10 lines
include/configs/ap152.h new file +10 -0
+#define CONFIG_SYS_BAUDRATE_TABLE \
+       {9600, 19200, 38400, 57600, 115200}
+
+#define CONFIG_BOOTCOMMAND              "sf probe;" \
+                                       "mtdparts default;" \
+                                       "bootm 0x9f060000"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "ipaddr=192.168.1.1\0" \
+       "serverip=192.168.1.10\0" \

boards in mainline must not have any pre-configured network settings. The user should either use "setenv ipaddr" or dhcp".

Quoted 18 lines
include/configs/ap152.h new file +15 -1
+
+#define CONFIG_ENV_SPI_MAX_HZ           25000000
+#define CONFIG_ENV_OFFSET               0x40000
+#define CONFIG_ENV_SECT_SIZE            0x10000
+#define CONFIG_ENV_SIZE                 0x10000
+
+/* Miscellaneous configurable options */
+
+/*
+ * Diagnostics
+ */
+#define CONFIG_SYS_MEMTEST_START        0x80100000
+#define CONFIG_SYS_MEMTEST_END          0x83f00000
+
+#endif  /* __CONFIG_H */
--

2.17.1

Signature · 1 line
- Daniel