Path: blob/master/arch/avr32/mach-at32ap/include/mach/hmatrix.h
10820 views
/*1* High-Speed Bus Matrix configuration registers2*3* Copyright (C) 2008 Atmel Corporation4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 2 as7* published by the Free Software Foundation.8*/9#ifndef __HMATRIX_H10#define __HMATRIX_H1112extern struct clk at32_hmatrix_clk;1314void hmatrix_write_reg(unsigned long offset, u32 value);15u32 hmatrix_read_reg(unsigned long offset);1617void hmatrix_sfr_set_bits(unsigned int slave_id, u32 mask);18void hmatrix_sfr_clear_bits(unsigned int slave_id, u32 mask);1920/* Master Configuration register */21#define HMATRIX_MCFG(m) (0x0000 + 4 * (m))22/* Undefined length burst limit */23# define HMATRIX_MCFG_ULBT_INFINITE 0 /* Infinite length */24# define HMATRIX_MCFG_ULBT_SINGLE 1 /* Single Access */25# define HMATRIX_MCFG_ULBT_FOUR_BEAT 2 /* Four beat */26# define HMATRIX_MCFG_ULBT_EIGHT_BEAT 3 /* Eight beat */27# define HMATRIX_MCFG_ULBT_SIXTEEN_BEAT 4 /* Sixteen beat */2829/* Slave Configuration register */30#define HMATRIX_SCFG(s) (0x0040 + 4 * (s))31# define HMATRIX_SCFG_SLOT_CYCLE(x) ((x) << 0) /* Max burst cycles */32# define HMATRIX_SCFG_DEFMSTR_NONE ( 0 << 16) /* No default master */33# define HMATRIX_SCFG_DEFMSTR_LAST ( 1 << 16) /* Last def master */34# define HMATRIX_SCFG_DEFMSTR_FIXED ( 2 << 16) /* Fixed def master */35# define HMATRIX_SCFG_FIXED_DEFMSTR(m) ((m) << 18) /* Fixed master ID */36# define HMATRIX_SCFG_ARBT_ROUND_ROBIN ( 0 << 24) /* RR arbitration */37# define HMATRIX_SCFG_ARBT_FIXED_PRIO ( 1 << 24) /* Fixed priority */3839/* Slave Priority register A (master 0..7) */40#define HMATRIX_PRAS(s) (0x0080 + 8 * (s))41# define HMATRIX_PRAS_PRIO(m, p) ((p) << ((m) * 4))4243/* Slave Priority register A (master 8..15) */44#define HMATRIX_PRBS(s) (0x0084 + 8 * (s))45# define HMATRIX_PRBS_PRIO(m, p) ((p) << (((m) - 8) * 4))4647/* Master Remap Control Register */48#define HMATRIX_MRCR 0x010049# define HMATRIX_MRCR_REMAP(m) ( 1 << (m)) /* Remap master m */5051/* Special Function Register. Bit definitions are chip-specific */52#define HMATRIX_SFR(s) (0x0110 + 4 * (s))5354#endif /* __HMATRIX_H */555657