162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef CARMINE_CARMINE_H
362306a36Sopenharmony_ci#define CARMINE_CARMINE_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#define CARMINE_MEMORY_BAR	2
662306a36Sopenharmony_ci#define CARMINE_CONFIG_BAR	3
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#define MAX_DISPLAY	2
962306a36Sopenharmony_ci#define CARMINE_DISPLAY_MEM	(800 * 600 * 4)
1062306a36Sopenharmony_ci#define CARMINE_TOTAL_DIPLAY_MEM	(CARMINE_DISPLAY_MEM * MAX_DISPLAY)
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define CARMINE_USE_DISPLAY0	(1 << 0)
1362306a36Sopenharmony_ci#define CARMINE_USE_DISPLAY1	(1 << 1)
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/*
1662306a36Sopenharmony_ci * This values work on the eval card. Custom boards may use different timings,
1762306a36Sopenharmony_ci * here an example :)
1862306a36Sopenharmony_ci */
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci/* DRAM initialization values */
2162306a36Sopenharmony_ci#ifdef CONFIG_FB_CARMINE_DRAM_EVAL
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define CARMINE_DFLT_IP_CLOCK_ENABLE		(0x03ff)
2462306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_ADD		(0x05c3)
2562306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_MODE		(0x0121)
2662306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_EMODE		(0x8000)
2762306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_SET_TIME1		(0x4749)
2862306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_SET_TIME2		(0x2a22)
2962306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_REFRESH		(0x0042)
3062306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_STATES		(0x0003)
3162306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_RESERVE0		(0x0020)
3262306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_FIFO_DEPTH		(0x000f)
3362306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_RESERVE2		(0x0000)
3462306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_DDRIF1		(0x6646)
3562306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_DDRIF2		(0x0055)
3662306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_MODE_AFT_RST	(0x0021)
3762306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_STATES_AFT_RST	(0x0002)
3862306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_IO_CONT0		(0x0555)
3962306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_IO_CONT1		(0x0555)
4062306a36Sopenharmony_ci#define CARMINE_DCTL_DLL_RESET			(1)
4162306a36Sopenharmony_ci#endif
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#ifdef CONFIG_CARMINE_DRAM_CUSTOM
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define CARMINE_DFLT_IP_CLOCK_ENABLE		(0x03ff)
4662306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_ADD		(0x03b2)
4762306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_MODE		(0x0161)
4862306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_EMODE		(0x8000)
4962306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_SET_TIME1		(0x2628)
5062306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_SET_TIME2		(0x1a09)
5162306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_REFRESH		(0x00fe)
5262306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_STATES		(0x0003)
5362306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_RESERVE0		(0x0020)
5462306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_FIFO_DEPTH		(0x000f)
5562306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_RESERVE2		(0x0000)
5662306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_DDRIF1		(0x0646)
5762306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_DDRIF2		(0x55aa)
5862306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_MODE_AFT_RST	(0x0061)
5962306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_STATES_AFT_RST	(0x0002)
6062306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_IO_CONT0		(0x0555)
6162306a36Sopenharmony_ci#define CARMINE_DFLT_IP_DCTL_IO_CONT1		(0x0555)
6262306a36Sopenharmony_ci#define CARMINE_DCTL_DLL_RESET			(1)
6362306a36Sopenharmony_ci#endif
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci#endif
66