aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap7000.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-02-01 10:34:10 -0500
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-04-27 06:58:50 -0400
commit9c8f8e752431f3f7ed6ea6ea6e491ce12057f572 (patch)
tree0ec81e8d5cd6239b8cd47990e7ae78e183b01a4f /arch/avr32/mach-at32ap/at32ap7000.c
parentde46c33745f5e2ad594c72f2cf5f490861b16ce1 (diff)
[AVR32] Add basic HMATRIX support
This adds register and clock definitions for the High-speed bus Matrix (HMATRIX) as well as a function that can be used to configure special EBI functionality like CompactFlash and NAND flash support. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap7000.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 472703f90c22..32c7045141c2 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -18,6 +18,7 @@
18#include <asm/arch/sm.h> 18#include <asm/arch/sm.h>
19 19
20#include "clock.h" 20#include "clock.h"
21#include "hmatrix.h"
21#include "pio.h" 22#include "pio.h"
22#include "sm.h" 23#include "sm.h"
23 24
@@ -467,6 +468,42 @@ static struct clk pico_clk = {
467}; 468};
468 469
469/* -------------------------------------------------------------------- 470/* --------------------------------------------------------------------
471 * HMATRIX
472 * -------------------------------------------------------------------- */
473
474static struct clk hmatrix_clk = {
475 .name = "hmatrix_clk",
476 .parent = &pbb_clk,
477 .mode = pbb_clk_mode,
478 .get_rate = pbb_clk_get_rate,
479 .index = 2,
480 .users = 1,
481};
482#define HMATRIX_BASE ((void __iomem *)0xfff00800)
483
484#define hmatrix_readl(reg) \
485 __raw_readl((HMATRIX_BASE) + HMATRIX_##reg)
486#define hmatrix_writel(reg,value) \
487 __raw_writel((value), (HMATRIX_BASE) + HMATRIX_##reg)
488
489/*
490 * Set bits in the HMATRIX Special Function Register (SFR) used by the
491 * External Bus Interface (EBI). This can be used to enable special
492 * features like CompactFlash support, NAND Flash support, etc. on
493 * certain chipselects.
494 */
495static inline void set_ebi_sfr_bits(u32 mask)
496{
497 u32 sfr;
498
499 clk_enable(&hmatrix_clk);
500 sfr = hmatrix_readl(SFR4);
501 sfr |= mask;
502 hmatrix_writel(SFR4, sfr);
503 clk_disable(&hmatrix_clk);
504}
505
506/* --------------------------------------------------------------------
470 * PIO 507 * PIO
471 * -------------------------------------------------------------------- */ 508 * -------------------------------------------------------------------- */
472 509
@@ -950,6 +987,7 @@ struct clk *at32_clock_list[] = {
950 &pbb_clk, 987 &pbb_clk,
951 &at32_sm_pclk, 988 &at32_sm_pclk,
952 &at32_intc0_pclk, 989 &at32_intc0_pclk,
990 &hmatrix_clk,
953 &ebi_clk, 991 &ebi_clk,
954 &hramc_clk, 992 &hramc_clk,
955 &smc0_pclk, 993 &smc0_pclk,