summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/include/mach/generic.h
blob: fa391c8d4813afc8e18e5f0467e8984d94ef205a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef _MACH_GENERIC_H
#define _MACH_GENERIC_H

/* I2C controller revisions */
#define OMAP_I2C_OMAP1_REV_2            0x20

/* I2C controller revisions present on specific hardware */
#define OMAP_I2C_REV_ON_2430		0x00000036
#define OMAP_I2C_REV_ON_3430_3530       0x0000003C
#define OMAP_I2C_REV_ON_3630            0x00000040
#define OMAP_I2C_REV_ON_4430_PLUS       0x50400002

extern unsigned int __omap_cpu_type;

#define OMAP_CPU_OMAP3		3
#define OMAP_CPU_OMAP4		4
#define OMAP_CPU_AM33XX		33

#ifdef CONFIG_ARCH_OMAP3
# ifdef omap_cpu_type
#  undef omap_cpu_type
#  define omap_cpu_type __omap_cpu_type
# else
#  define omap_cpu_type OMAP_CPU_OMAP3
# endif
# define cpu_is_omap3()		(omap_cpu_type == OMAP_CPU_OMAP3)
#else
# define cpu_is_omap3()		(0)
#endif

#ifdef CONFIG_ARCH_OMAP4
# ifdef omap_cpu_type
#  undef omap_cpu_type
#  define omap_cpu_type __omap_cpu_type
# else
#  define omap_cpu_type OMAP_CPU_OMAP4
# endif
# define cpu_is_omap4()		(omap_cpu_type == OMAP_CPU_OMAP4)
#else
# define cpu_is_omap4()		(0)
#endif

#ifdef CONFIG_ARCH_AM33XX
# ifdef omap_cpu_type
#  undef omap_cpu_type
#  define omap_cpu_type __omap_cpu_type
# else
#  define omap_cpu_type OMAP_CPU_AM33XX
# endif
# define cpu_is_am33xx()		(omap_cpu_type == OMAP_CPU_AM33XX)
#else
# define cpu_is_am33xx()	(0)
#endif

struct omap_barebox_part {
	unsigned int nand_offset;
	unsigned int nand_size;
	unsigned int nand_bkup_offset;
	unsigned int nand_bkup_size;
	unsigned int nor_offset;
	unsigned int nor_size;
};

#ifdef CONFIG_SHELL_NONE
int omap_set_barebox_part(struct omap_barebox_part *part);
int omap_set_mmc_dev(const char *mmcdev);
#else
static inline int omap_set_barebox_part(struct omap_barebox_part *part)
{
	return 0;
}
static inline int omap_set_mmc_dev(const char *mmcdev)
{
	return 0;
}
#endif

void __noreturn omap_start_barebox(void *barebox);

void omap_set_bootmmc_devname(const char *devname);
const char *omap_get_bootmmc_devname(void);

#endif