xref: /openbmc/u-boot/arch/arm/mach-at91/include/mach/sama5_sfr.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2af930827SMasahiro Yamada /*
3af930827SMasahiro Yamada  * Special Function Register (SFR)
4af930827SMasahiro Yamada  *
5af930827SMasahiro Yamada  * Copyright (C) 2014 Atmel
6af930827SMasahiro Yamada  *		      Bo Shen <voice.shen@atmel.com>
7af930827SMasahiro Yamada  */
8af930827SMasahiro Yamada 
9af930827SMasahiro Yamada #ifndef __SAMA5_SFR_H
10af930827SMasahiro Yamada #define __SAMA5_SFR_H
11af930827SMasahiro Yamada 
12af930827SMasahiro Yamada struct atmel_sfr {
13af930827SMasahiro Yamada 	u32 reserved1;	/* 0x00 */
14af930827SMasahiro Yamada 	u32 ddrcfg;	/* 0x04: DDR Configuration Register */
15af930827SMasahiro Yamada 	u32 reserved2;	/* 0x08 */
16af930827SMasahiro Yamada 	u32 reserved3;	/* 0x0c */
17af930827SMasahiro Yamada 	u32 ohciicr;	/* 0x10: OHCI Interrupt Configuration Register */
18af930827SMasahiro Yamada 	u32 ohciisr;	/* 0x14: OHCI Interrupt Status Register */
19af930827SMasahiro Yamada 	u32 reserved4[4];	/* 0x18 ~ 0x24 */
20af930827SMasahiro Yamada 	u32 secure;		/* 0x28: Security Configuration Register */
21af930827SMasahiro Yamada 	u32 reserved5[5];	/* 0x2c ~ 0x3c */
22af930827SMasahiro Yamada 	u32 ebicfg;		/* 0x40: EBI Configuration Register */
23af930827SMasahiro Yamada 	u32 reserved6[2];	/* 0x44 ~ 0x48 */
24af930827SMasahiro Yamada 	u32 sn0;		/* 0x4c */
25af930827SMasahiro Yamada 	u32 sn1;		/* 0x50 */
26af930827SMasahiro Yamada 	u32 aicredir;	/* 0x54 */
27f7cf291aSSamuel Mescoff 	u32 l2cc_hramc;	/* 0x58 */
28af930827SMasahiro Yamada };
29af930827SMasahiro Yamada 
30e7c83154SWenyou Yang /* Register Mapping*/
31e7c83154SWenyou Yang #define AT91_SFR_UTMICKTRIM	0x30	/* UTMI Clock Trimming Register */
32e7c83154SWenyou Yang 
33af930827SMasahiro Yamada /* Bit field in DDRCFG */
34af930827SMasahiro Yamada #define ATMEL_SFR_DDRCFG_FDQIEN		0x00010000
35af930827SMasahiro Yamada #define ATMEL_SFR_DDRCFG_FDQSIEN	0x00020000
36af930827SMasahiro Yamada 
37cc434ad5SWenyou Yang /* Bit field in EBICFG */
38cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE0		(0x3 << 0)
39cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE0_LOW		(0x0 << 0)
40cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE0_MEDIUM		(0x2 << 0)
41cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE0_HIGH		(0x3 << 0)
42cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL0		(0x3 << 2)
43cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL0_UP		(0x0 << 2)
44cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL0_NONE		(0x1 << 2)
45cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL0_DOWN		(0x3 << 2)
46cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_SCH0		(0x1 << 4)
47cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_SCH0_OFF		(0x0 << 4)
48cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_SCH0_ON			(0x1 << 4)
49cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE1		(0x3 << 8)
50cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE1_LOW		(0x0 << 8)
51cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE1_MEDIUM		(0x2 << 8)
52cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_DRIVE1_HIGH		(0x3 << 8)
53cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL1		(0x3 << 10)
54cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL1_UP		(0x0 << 10)
55cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL1_NONE		(0x1 << 10)
56cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_PULL1_DOWN		(0x3 << 10)
57cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_SCH1		(0x1 << 12)
58cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_SCH1_OFF		(0x0 << 12)
59cc434ad5SWenyou Yang #define AT91_SFR_EBICFG_SCH1_ON			(0x1 << 12)
60cc434ad5SWenyou Yang 
61e7c83154SWenyou Yang #define AT91_UTMICKTRIM_FREQ		GENMASK(1, 0)
62e7c83154SWenyou Yang 
63af930827SMasahiro Yamada /* Bit field in AICREDIR */
64af930827SMasahiro Yamada #define ATMEL_SFR_AICREDIR_NSAIC	0x00000001
65af930827SMasahiro Yamada 
66af930827SMasahiro Yamada #endif
67