From 36e8fc08726fcf40071aad48f20df004d9c499ef Mon Sep 17 00:00:00 2001 From: Vitja Makarov Date: Fri, 18 Sep 2009 05:48:37 +0000 Subject: tcc77x: add tcc77x_cscfg_bw() helper for external memory bus width setup git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22729 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/tcc77x/system-target.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'firmware/target/arm/tcc77x/system-target.h') 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 */ -- cgit v1.2.3