[OpenWrt-Devel] ar71xx:Add QCA953X version2 SoC support
diff mbox

Message ID 1422794880-14119-1-git-send-email-gch981213@gmail.com
State Accepted
Headers show

Commit Message

Chuanhong Guo Feb. 1, 2015, 12:48 p.m. UTC
From: 郭传鈜 <gch981213@gmail.com>

This patch adds support for QCA953Xv2 SoC.
I got this patch from QSDK here: https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/tree/target/linux/ar71xx/patches-3.3/627-QCA-MIPS-ath79-add-QCA9531-version2-support.patch?h=release/banana_10.4_c1
This patch is tested on QCA9533-BL3A and everything seems to be OK.
Signed-off-by: 郭传鈜 <gch981213@gmail.com>
---
 ...6-MIPS-ath79-add-QCA953X-version2-support.patch | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch

Comments

John Crispin Feb. 10, 2015, 6:55 p.m. UTC | #1
Hi,

late reply, see below

On 01/02/2015 13:48, Chuanhong Guo wrote:
> From: 郭传鈜 <gch981213@gmail.com>
> 
> This patch adds support for QCA953Xv2 SoC.
> I got this patch from QSDK here: https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/tree/target/linux/ar71xx/patches-3.3/627-QCA-MIPS-ath79-add-QCA9531-version2-support.patch?h=release/banana_10.4_c1
> This patch is tested on QCA9533-BL3A and everything seems to be OK.
> Signed-off-by: 郭传鈜 <gch981213@gmail.com>
> ---
>  ...6-MIPS-ath79-add-QCA953X-version2-support.patch | 41 ++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>  create mode 100644 target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch
> 
> diff --git a/target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch b/target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch

[...]


> +--- a/arch/mips/ath79/setup.c
> ++++ b/arch/mips/ath79/setup.c
> +@@ -152,10 +152,13 @@
> + 		rev = id & AR934X_REV_ID_REVISION_MASK;
> + 		break;
> + 
> +-	case REV_ID_MAJOR_QCA9533:
> ++	case REV_ID_MAJOR_QCA9533_V1:
> ++	case REV_ID_MAJOR_QCA9533_V2:
> + 		ath79_soc = ATH79_SOC_QCA9533;
> + 		chip = "9533";
> + 		rev = id & QCA953X_REV_ID_REVISION_MASK;
> ++		if (major == REV_ID_MAJOR_QCA9533_V2)
> ++			rev = 2;

i wanted to confirm this first and it turns out it is almost correct
there is one case missing. after confirming with mathieu (thanks!) the
following ids should be used

0x140 – v1.0
0x141 – v1.1
0x160 – v2.0

i will rework your patch in the morning and add both of the new ids.

	John



> + 		break;
> + 
> + 	case REV_ID_MAJOR_QCA9556:
> +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
> ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
> +@@ -709,7 +709,8 @@
> + #define REV_ID_MAJOR_AR9341		0x0120
> + #define REV_ID_MAJOR_AR9342		0x1120
> + #define REV_ID_MAJOR_AR9344		0x2120
> +-#define REV_ID_MAJOR_QCA9533		0x0140
> ++#define REV_ID_MAJOR_QCA9533_V1	0x0140
> ++#define REV_ID_MAJOR_QCA9533_V2	0x0160
> + #define REV_ID_MAJOR_QCA9556		0x0130
> + #define REV_ID_MAJOR_QCA9558		0x1130
> + #define REV_ID_MAJOR_TP9343		0x0150
>

Patch
diff mbox

diff --git a/target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch b/target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch
new file mode 100644
index 0000000..0dbd737
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.14/736-MIPS-ath79-add-QCA953X-version2-support.patch
@@ -0,0 +1,41 @@ 
+--- a/arch/mips/ath79/early_printk.c
++++ b/arch/mips/ath79/early_printk.c
+@@ -114,7 +114,8 @@
+ 	case REV_ID_MAJOR_AR9341:
+ 	case REV_ID_MAJOR_AR9342:
+ 	case REV_ID_MAJOR_AR9344:
+-	case REV_ID_MAJOR_QCA9533:
++	case REV_ID_MAJOR_QCA9533_V1:
++	case REV_ID_MAJOR_QCA9533_V2:
+ 	case REV_ID_MAJOR_QCA9556:
+ 	case REV_ID_MAJOR_QCA9558:
+ 	case REV_ID_MAJOR_TP9343:
+--- a/arch/mips/ath79/setup.c
++++ b/arch/mips/ath79/setup.c
+@@ -152,10 +152,13 @@
+ 		rev = id & AR934X_REV_ID_REVISION_MASK;
+ 		break;
+ 
+-	case REV_ID_MAJOR_QCA9533:
++	case REV_ID_MAJOR_QCA9533_V1:
++	case REV_ID_MAJOR_QCA9533_V2:
+ 		ath79_soc = ATH79_SOC_QCA9533;
+ 		chip = "9533";
+ 		rev = id & QCA953X_REV_ID_REVISION_MASK;
++		if (major == REV_ID_MAJOR_QCA9533_V2)
++			rev = 2;
+ 		break;
+ 
+ 	case REV_ID_MAJOR_QCA9556:
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+@@ -709,7 +709,8 @@
+ #define REV_ID_MAJOR_AR9341		0x0120
+ #define REV_ID_MAJOR_AR9342		0x1120
+ #define REV_ID_MAJOR_AR9344		0x2120
+-#define REV_ID_MAJOR_QCA9533		0x0140
++#define REV_ID_MAJOR_QCA9533_V1	0x0140
++#define REV_ID_MAJOR_QCA9533_V2	0x0160
+ #define REV_ID_MAJOR_QCA9556		0x0130
+ #define REV_ID_MAJOR_QCA9558		0x1130
+ #define REV_ID_MAJOR_TP9343		0x0150