xref: /openbmc/u-boot/arch/arm/mach-exynos/include/mach/sromc.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
277b55e8cSThomas Abraham /*
377b55e8cSThomas Abraham  * (C) Copyright 2010 Samsung Electronics
477b55e8cSThomas Abraham  * Naveen Krishna Ch <ch.naveen@samsung.com>
577b55e8cSThomas Abraham  *
677b55e8cSThomas Abraham  * Note: This file contains the register description for SROMC
777b55e8cSThomas Abraham  */
877b55e8cSThomas Abraham 
977b55e8cSThomas Abraham #ifndef __ASM_ARCH_SROMC_H_
1077b55e8cSThomas Abraham #define __ASM_ARCH_SROMC_H_
1177b55e8cSThomas Abraham 
1277b55e8cSThomas Abraham #define SROMC_DATA16_WIDTH(x)    (1<<((x*4)+0))
1377b55e8cSThomas Abraham #define SROMC_BYTE_ADDR_MODE(x)  (1<<((x*4)+1))  /* 0-> Half-word base address*/
1477b55e8cSThomas Abraham 						/* 1-> Byte base address*/
1577b55e8cSThomas Abraham #define SROMC_WAIT_ENABLE(x)     (1<<((x*4)+2))
1677b55e8cSThomas Abraham #define SROMC_BYTE_ENABLE(x)     (1<<((x*4)+3))
1777b55e8cSThomas Abraham 
1877b55e8cSThomas Abraham #define SROMC_BC_TACS(x) (x << 28) /* address set-up */
1977b55e8cSThomas Abraham #define SROMC_BC_TCOS(x) (x << 24) /* chip selection set-up */
2077b55e8cSThomas Abraham #define SROMC_BC_TACC(x) (x << 16) /* access cycle */
2177b55e8cSThomas Abraham #define SROMC_BC_TCOH(x) (x << 12) /* chip selection hold */
2277b55e8cSThomas Abraham #define SROMC_BC_TAH(x)  (x << 8)  /* address holding time */
2377b55e8cSThomas Abraham #define SROMC_BC_TACP(x) (x << 4)  /* page mode access cycle */
2477b55e8cSThomas Abraham #define SROMC_BC_PMC(x)  (x << 0)  /* normal(1data)page mode configuration */
2577b55e8cSThomas Abraham 
2677b55e8cSThomas Abraham #ifndef __ASSEMBLY__
2777b55e8cSThomas Abraham struct s5p_sromc {
2877b55e8cSThomas Abraham 	unsigned int	bw;
2977b55e8cSThomas Abraham 	unsigned int	bc[4];
3077b55e8cSThomas Abraham };
3177b55e8cSThomas Abraham #endif	/* __ASSEMBLY__ */
3277b55e8cSThomas Abraham 
3377b55e8cSThomas Abraham /* Configure the Band Width and Bank Control Regs for required SROMC Bank */
3477b55e8cSThomas Abraham void s5p_config_sromc(u32 srom_bank, u32 srom_bw_conf, u32 srom_bc_conf);
3577b55e8cSThomas Abraham 
3677b55e8cSThomas Abraham enum {
3777b55e8cSThomas Abraham 	FDT_SROM_PMC,
3877b55e8cSThomas Abraham 	FDT_SROM_TACP,
3977b55e8cSThomas Abraham 	FDT_SROM_TAH,
4077b55e8cSThomas Abraham 	FDT_SROM_TCOH,
4177b55e8cSThomas Abraham 	FDT_SROM_TACC,
4277b55e8cSThomas Abraham 	FDT_SROM_TCOS,
4377b55e8cSThomas Abraham 	FDT_SROM_TACS,
4477b55e8cSThomas Abraham 
4577b55e8cSThomas Abraham 	FDT_SROM_TIMING_COUNT,
4677b55e8cSThomas Abraham };
4777b55e8cSThomas Abraham 
4877b55e8cSThomas Abraham struct fdt_sromc {
4977b55e8cSThomas Abraham 	u8 bank;	/* srom bank number */
5077b55e8cSThomas Abraham 	u8 width;	/* bus width in bytes */
5177b55e8cSThomas Abraham 	unsigned int timing[FDT_SROM_TIMING_COUNT]; /* timing parameters */
5277b55e8cSThomas Abraham };
5377b55e8cSThomas Abraham 
5477b55e8cSThomas Abraham #endif /* __ASM_ARCH_SROMC_H_ */
55