[U-Boot] [PATCH 2/6] avr32: Add clk and portmux infrastructure for the LCDC
Haavard Skinnemoen
haavard.skinnemoen at atmel.com
Tue Sep 2 11:20:50 CEST 2008
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
---
cpu/at32ap/at32ap700x/portmux.c | 14 ++++++++++++++
include/asm-avr32/arch-at32ap700x/chip-features.h | 5 +++++
include/asm-avr32/arch-at32ap700x/clk.h | 6 ++++++
include/asm-avr32/arch-at32ap700x/portmux.h | 3 +++
4 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/cpu/at32ap/at32ap700x/portmux.c b/cpu/at32ap/at32ap700x/portmux.c
index 2a3b004..da0c9c5 100644
--- a/cpu/at32ap/at32ap700x/portmux.c
+++ b/cpu/at32ap/at32ap700x/portmux.c
@@ -202,3 +202,17 @@ void portmux_enable_spi1(unsigned long cs_mask, unsigned long drive_strength)
PORTMUX_DIR_OUTPUT | PORTMUX_INIT_HIGH);
}
#endif
+
+#ifdef AT32AP700x_CHIP_HAS_LCDC
+void portmux_enable_lcdc(void)
+{
+ /*
+ * FIXME: We want to allow the board much more control over
+ * which pins to enable
+ */
+ portmux_select_peripheral(PORTMUX_PORT_C, 0xfff80000,
+ PORTMUX_FUNC_A, 0);
+ portmux_select_peripheral(PORTMUX_PORT_D, 0x0003ffff,
+ PORTMUX_FUNC_A, 0);
+}
+#endif
diff --git a/include/asm-avr32/arch-at32ap700x/chip-features.h b/include/asm-avr32/arch-at32ap700x/chip-features.h
index c47107e..b6bd1cd 100644
--- a/include/asm-avr32/arch-at32ap700x/chip-features.h
+++ b/include/asm-avr32/arch-at32ap700x/chip-features.h
@@ -32,4 +32,9 @@
#define AT32AP700x_CHIP_HAS_MACB
#endif
+/* AP7001 doesn't have a LCD controller */
+#if defined(CONFIG_AT32AP7000) || defined(CONFIG_AT32AP7002)
+#define AT32AP700x_CHIP_HAS_LCDC
+#endif
+
#endif /* __ASM_AVR32_ARCH_CHIP_FEATURES_H__ */
diff --git a/include/asm-avr32/arch-at32ap700x/clk.h b/include/asm-avr32/arch-at32ap700x/clk.h
index 21545a3..83a76f2 100644
--- a/include/asm-avr32/arch-at32ap700x/clk.h
+++ b/include/asm-avr32/arch-at32ap700x/clk.h
@@ -82,6 +82,12 @@ static inline unsigned long get_spi_clk_rate(unsigned int dev_id)
return get_pba_clk_rate();
}
#endif
+#ifdef AT32AP700x_CHIP_HAS_LCDC
+static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id)
+{
+ return CONFIG_LCDC_PIXCLK_RATE;
+}
+#endif
extern void clk_init(void);
diff --git a/include/asm-avr32/arch-at32ap700x/portmux.h b/include/asm-avr32/arch-at32ap700x/portmux.h
index 96fe70d..491d588 100644
--- a/include/asm-avr32/arch-at32ap700x/portmux.h
+++ b/include/asm-avr32/arch-at32ap700x/portmux.h
@@ -85,5 +85,8 @@ void portmux_enable_mmci(unsigned int slot, unsigned long flags,
void portmux_enable_spi0(unsigned long cs_mask, unsigned long drive_strength);
void portmux_enable_spi1(unsigned long cs_mask, unsigned long drive_strength);
#endif
+#ifdef AT32AP700x_CHIP_HAS_LCDC
+void portmux_enable_lcdc(void);
+#endif
#endif /* __ASM_AVR32_ARCH_PORTMUX_H__ */
--
1.5.6.3
More information about the U-Boot
mailing list