summaryrefslogtreecommitdiff
path: root/firmware/export/system.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-11-07 23:07:19 +0000
committerDave Chapman <dave@dchapman.com>2005-11-07 23:07:19 +0000
commit77372d12189c70cb810a7e88bc2ee7a56f64646c (patch)
tree057d0d474042874850b6262b78f80d2335cb0629 /firmware/export/system.h
parent3cd5c646d03089df8d58b773d4a1bc8323021adc (diff)
Initial commit of work-in-progress iPod port
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7781 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/system.h')
-rw-r--r--firmware/export/system.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 313a9a8e4c..15c6edb00e 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -29,6 +29,13 @@ extern void system_init(void);
extern long cpu_frequency;
+#if CONFIG_CPU==PP5020
+#define inl(a) (*(volatile unsigned long *) (a))
+#define outl(a,b) (*(volatile unsigned long *) (b) = (a))
+#define inb(a) (*(volatile unsigned char *) (a))
+#define outb(a,b) (*(volatile unsigned char *) (b) = (a))
+#endif
+
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
#define FREQ cpu_frequency
void set_cpu_frequency(long frequency);
@@ -285,6 +292,43 @@ static inline void invalidate_icache(void)
#define CPUFREQ_MAX_MULT 11
#define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ)
+#elif CONFIG_CPU == PP5020
+
+#warning Implement set_irq_level and check CPU frequencies
+
+#define CPUFREQ_DEFAULT CPU_FREQ
+#define CPUFREQ_NORMAL 37500000
+#define CPUFREQ_MAX 75000000
+
+static inline unsigned short swap16(unsigned short value)
+ /*
+ result[15..8] = value[ 7..0];
+ result[ 7..0] = value[15..8];
+ */
+{
+ return (value >> 8) | (value << 8);
+}
+
+static inline unsigned long swap32(unsigned long value)
+ /*
+ result[31..24] = value[ 7.. 0];
+ result[23..16] = value[15.. 8];
+ result[15.. 8] = value[23..16];
+ result[ 7.. 0] = value[31..24];
+ */
+{
+ unsigned long hi = swap16(value >> 16);
+ unsigned long lo = swap16(value & 0xffff);
+ return (lo << 16) | hi;
+}
+
+#define HIGHEST_IRQ_LEVEL (1)
+static inline int set_irq_level(int level)
+{
+ int result=level;
+ return result;
+}
+
#elif CONFIG_CPU == TCC730
extern int smsc_version(void);