summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/tcc77x
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tcc77x')
-rw-r--r--firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c2
-rw-r--r--firmware/target/arm/tcc77x/system-target.h13
2 files changed, 14 insertions, 1 deletions
diff --git a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
index ef7e1ec140..6da0d2c083 100644
--- a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
+++ b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
@@ -128,7 +128,7 @@ static void _display_on(void)
void lcd_init_device(void)
{
/* Configure external memory banks */
- CSCFG1 = 0x2d500023 | (((MCFG >> 11) & 1) << 28);
+ CSCFG1 = 0x0d500023 | tcc77x_cscfg_bw(TCC77X_CSCFG_BW16);
/* may be reset */
GPIOA |= 0x8000;
diff --git a/firmware/target/arm/tcc77x/system-target.h b/firmware/target/arm/tcc77x/system-target.h
index 55dd52ef47..beeeac05c6 100644
--- a/firmware/target/arm/tcc77x/system-target.h
+++ b/firmware/target/arm/tcc77x/system-target.h
@@ -43,4 +43,17 @@ static inline void udelay(unsigned usecs)
while (TIME_BEFORE(USEC_TIMER, stop));
}
+
+#define TCC77X_CSCFG_BW8 0
+#define TCC77X_CSCFG_BW16 1
+
+/* Due to hardware bug or "feature" this hack is needed to set bus width bits */
+static inline
+unsigned long tcc77x_cscfg_bw(int bw) {
+ if (bw == TCC77X_CSCFG_BW8)
+ return (((MCFG >> 11) & 3) ^ 3) << 28;
+ else
+ return (((MCFG >> 11) & 3) ^ 2) << 28;
+}
+
#endif /* SYSTEM_TARGET_H */