aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-12-17 09:26:28 +0000
committerJohn Crispin <blogic@openwrt.org>2015-12-17 09:26:28 +0000
commit473ff842f255b909effaf11b4798e092ab84ccf9 (patch)
tree062e87220166c1b16090c5d210748584d763cc9d /target/linux
parent6a3b1208aedc992bd0b1a5cec4720c4906fdb302 (diff)
downloadmaster-187ad058-473ff842f255b909effaf11b4798e092ab84ccf9.tar.gz
master-187ad058-473ff842f255b909effaf11b4798e092ab84ccf9.tar.bz2
master-187ad058-473ff842f255b909effaf11b4798e092ab84ccf9.zip
ramips: mt7621: add patch to setup CM memory region for palmbus
This is tested and works on ubnt-erx. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47903 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ramips/patches-4.3/0060-mt7621-set-up-palmbus-memory-region.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-4.3/0060-mt7621-set-up-palmbus-memory-region.patch b/target/linux/ramips/patches-4.3/0060-mt7621-set-up-palmbus-memory-region.patch
new file mode 100644
index 0000000000..ba462bf92e
--- /dev/null
+++ b/target/linux/ramips/patches-4.3/0060-mt7621-set-up-palmbus-memory-region.patch
@@ -0,0 +1,36 @@
+--- a/arch/mips/include/asm/mach-ralink/mt7621.h
++++ b/arch/mips/include/asm/mach-ralink/mt7621.h
+@@ -13,6 +13,9 @@
+ #ifndef _MT7621_REGS_H_
+ #define _MT7621_REGS_H_
+
++#define MT7621_PALMBUS_BASE 0x1C000000
++#define MT7621_PALMBUS_SIZE 0x03FFFFFF
++
+ #define MT7621_SYSC_BASE 0x1E000000
+
+ #define SYSC_REG_CHIP_NAME0 0x00
+--- a/arch/mips/ralink/mt7621.c
++++ b/arch/mips/ralink/mt7621.c
+@@ -204,6 +204,21 @@ void prom_soc_init(struct ralink_soc_inf
+ mips_cm_probe();
+ mips_cpc_probe();
+
++ if (mips_cm_numiocu()) {
++ /* mips_cm_probe() wipes out bootloader
++ config for CM regions and we have to configure them
++ again. This SoC cannot talk to pamlbus devices
++ witout proper iocu region set up.
++
++ FIXME: it would be better to do this with values
++ from DT, but we need this very early because
++ without this we cannot talk to pretty much anything
++ including serial.
++ */
++ write_gcr_reg0_base(MT7621_PALMBUS_BASE);
++ write_gcr_reg0_mask(~MT7621_PALMBUS_SIZE | CM_GCR_REGn_MASK_CMTGT_IOCU0);
++ }
++
+ if (!register_cps_smp_ops())
+ return;
+ if (!register_cmp_smp_ops())