Convert CONFIG_SYS_NAND_ONFI_DETECTION to Kconfig
[platform/kernel/u-boot.git] / include / configs / phycore_am335x_r2.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * phycore_am335x_r2.h
4  *
5  * Phytec phyCORE-AM335x R2 (PCL060 / PCM060) boards information header
6  *
7  * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
8  * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
9  * Copyright (C) 2019 DENX Software Engineering GmbH
10  */
11
12 #ifndef __CONFIG_PHYCORE_AM335x_R2_H
13 #define __CONFIG_PHYCORE_AM335x_R2_H
14
15 #include <configs/ti_am335x_common.h>
16
17 #ifdef CONFIG_MTD_RAW_NAND
18 #define NANDARGS \
19         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
20         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
21         "nandargs=setenv bootargs console=${console} " \
22                 "${optargs} " \
23                 "root=${nandroot} " \
24                 "rootfstype=${nandrootfstype}\0" \
25         "nandroot=ubi0:root ubi.mtd=NAND.UBI\0" \
26         "nandrootfstype=ubifs rootwait rw fsck.repair=yes\0" \
27         "nandboot=echo Booting from nand ...; " \
28                 "run nandargs; " \
29                 "ubi part NAND.UBI; " \
30                 "ubi readvol ${fdtaddr} oftree; " \
31                 "ubi readvol ${loadaddr} kernel; " \
32                 "bootz ${loadaddr} - ${fdtaddr}\0"
33
34 #else
35 #define NANDARGS ""
36 #endif
37
38 /* set to negative value for no autoboot */
39 #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
40         "bootcmd_" #devtypel #instance "=" \
41         "setenv mmcdev " #instance "; "\
42         "setenv bootpart " #instance ":1 ; "\
43         "setenv rootpart " #instance ":2 ; "\
44         "run mmcboot\0"
45
46 #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
47         #devtypel #instance " "
48
49 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
50         "bootcmd_" #devtypel #instance "=" \
51         "run nandboot\0"
52
53 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
54         #devtypel #instance " "
55
56 #define BOOT_TARGET_DEVICES(func) \
57         func(MMC, mmc, 0) \
58         func(LEGACY_MMC, legacy_mmc, 0) \
59         func(MMC, mmc, 1) \
60         func(LEGACY_MMC, legacy_mmc, 1) \
61         func(NAND, nand, 0)
62
63 #include <config_distro_bootcmd.h>
64 #include <environment/ti/dfu.h>
65 #include <environment/ti/mmc.h>
66
67 #define CONFIG_EXTRA_ENV_SETTINGS \
68         DEFAULT_MMC_TI_ARGS \
69         DEFAULT_LINUX_BOOT_ENV \
70         "bootfile=zImage\0" \
71         "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
72         "console=ttyS0,115200\0" \
73         "optargs=\0" \
74         "mmcrootfstype=ext2 rootwait\0" \
75         "finduuid=part uuid mmc ${rootpart} uuid\0" \
76         "boot_fit=0\0" \
77         NANDARGS \
78         BOOTENV
79
80 /* Clock Macros */
81 #define V_OSCK                          25000000  /* Clock output from T2 */
82 #define V_SCLK                          V_OSCK
83
84 #define CONFIG_POWER_TPS65910
85
86 #ifdef CONFIG_MTD_RAW_NAND
87 /* NAND: device related configs */
88 /* NAND: driver related configs */
89 #define CONFIG_SYS_NAND_ECCPOS          { 2, 3, 4, 5, 6, 7, 8, 9, \
90                                          10, 11, 12, 13, 14, 15, 16, 17, \
91                                          18, 19, 20, 21, 22, 23, 24, 25, \
92                                          26, 27, 28, 29, 30, 31, 32, 33, \
93                                          34, 35, 36, 37, 38, 39, 40, 41, \
94                                          42, 43, 44, 45, 46, 47, 48, 49, \
95                                          50, 51, 52, 53, 54, 55, 56, 57, }
96
97 #define CONFIG_SYS_NAND_ECCSIZE         512
98 #define CONFIG_SYS_NAND_ECCBYTES        14
99 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW
100
101 /* NAND: SPL related configs */
102 #ifdef CONFIG_SPL_OS_BOOT
103 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
104 #endif
105 #endif /* !CONFIG_MTD_RAW_NAND */
106
107 /* CPU */
108
109 #ifdef CONFIG_SPI_BOOT
110 #define CONFIG_SYS_SPI_U_BOOT_SIZE      0x40000
111 #endif
112
113 #endif  /* ! __CONFIG_PHYCORE_AM335x_R2_H */