Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Configuration settings for CompuLab CL-SOM-AM57x board |
| 3 | * |
| 4 | * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/ |
| 5 | * |
| 6 | * Author: Dmitry Lifshitz <lifshitz@compulab.co.il> |
| 7 | * |
| 8 | * SPDX-License-Identifier: GPL-2.0+ |
| 9 | */ |
| 10 | |
| 11 | #ifndef __CONFIG_CL_SOM_AM57X_H |
| 12 | #define __CONFIG_CL_SOM_AM57X_H |
| 13 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 14 | #define CONFIG_NR_DRAM_BANKS 2 |
| 15 | |
| 16 | #define CONSOLEDEV "ttyO2" |
| 17 | #define CONFIG_SYS_NS16550_COM3 UART3_BASE /* UART3 */ |
| 18 | #define CONFIG_CONS_INDEX 3 |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 19 | |
| 20 | #define CONFIG_SYS_OMAP_ABE_SYSCK |
| 21 | |
| 22 | #include <configs/ti_omap5_common.h> |
| 23 | |
Dmitry Lifshitz | 39f9cf0 | 2016-12-28 18:28:34 +0200 | [diff] [blame] | 24 | /* misc */ |
| 25 | #define CONFIG_MISC_INIT_R |
| 26 | #define CONFIG_REVISION_TAG |
| 27 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 28 | /* PMIC I2C bus number */ |
| 29 | #define CONFIG_SYS_SPD_BUS_NUM 3 |
| 30 | |
| 31 | /* SPI Flash support */ |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 32 | #define CONFIG_TI_SPI_MMAP |
| 33 | #define CONFIG_SF_DEFAULT_SPEED 48000000 |
| 34 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3 |
| 35 | |
| 36 | /* SPI SPL defines */ |
| 37 | /* Offsets: 0K - SPL1, 64K - SPL2, 128K - SPL3, 192K - SPL4, 256K - U-Boot */ |
| 38 | #define CONFIG_SYS_SPI_U_BOOT_OFFS (256 * 1024) |
| 39 | #define CONFIG_SPL_SPI_SUPPORT |
| 40 | #define CONFIG_SPL_SPI_FLASH_SUPPORT |
| 41 | #define CONFIG_SPL_SPI_LOAD |
| 42 | |
Uri Mashiach | b72165b | 2017-05-17 17:29:25 +0300 | [diff] [blame] | 43 | /* SD/MMC RAW/FS boot */ |
| 44 | #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" |
| 45 | #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 46 | |
| 47 | /* Environment */ |
| 48 | #define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB env size */ |
| 49 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
| 50 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 51 | #define CONFIG_ENV_SECT_SIZE (64 * 1024) |
| 52 | #define CONFIG_ENV_OFFSET (768 * 1024) |
| 53 | #define CONFIG_ENV_SPI_MAX_HZ 48000000 |
| 54 | |
Dmitry Lifshitz | 39f9cf0 | 2016-12-28 18:28:34 +0200 | [diff] [blame] | 55 | /* EEPROM */ |
| 56 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 |
| 57 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 |
| 58 | #define CONFIG_SYS_I2C_EEPROM_BUS 3 |
| 59 | |
Dmitry Lifshitz | 39f9cf0 | 2016-12-28 18:28:34 +0200 | [diff] [blame] | 60 | #define CONFIG_ENV_EEPROM_IS_ON_I2C |
| 61 | #define CONFIG_SYS_EEPROM_SIZE 256 |
| 62 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 63 | #ifndef CONFIG_SPL_BUILD |
| 64 | /* SATA */ |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 65 | #define CONFIG_SCSI_AHCI_PLAT |
| 66 | #define CONFIG_SYS_SCSI_MAX_SCSI_ID 1 |
| 67 | #define CONFIG_SYS_SCSI_MAX_LUN 1 |
| 68 | #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ |
| 69 | CONFIG_SYS_SCSI_MAX_LUN) |
| 70 | /* PCA9555 GPIO expander support */ |
| 71 | #define CONFIG_PCA953X |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 72 | #define CONFIG_SYS_I2C_PCA953X_ADDR 0x20 |
| 73 | #define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} } |
| 74 | |
Uri Mashiach | dcb93a5 | 2017-02-23 15:39:39 +0200 | [diff] [blame] | 75 | #endif /* !CONFIG_SPL_BUILD */ |
| 76 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 77 | /* USB xHCI HOST */ |
| 78 | #define CONFIG_USB_XHCI_OMAP |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 79 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 80 | #define CONFIG_OMAP_USB3PHY1_HOST |
| 81 | |
| 82 | /* USB Networking options */ |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 83 | |
Dmitry Lifshitz | 1f182e1 | 2016-12-28 18:28:35 +0200 | [diff] [blame] | 84 | /* CPSW Ethernet */ |
| 85 | #define CONFIG_DRIVER_TI_CPSW |
| 86 | #define CONFIG_MII |
| 87 | #define CONFIG_BOOTP_DEFAULT |
| 88 | #define CONFIG_BOOTP_SEND_HOSTNAME |
| 89 | #define CONFIG_BOOTP_GATEWAY |
Dmitry Lifshitz | 1f182e1 | 2016-12-28 18:28:35 +0200 | [diff] [blame] | 90 | #define CONFIG_PHY_ATHEROS |
Dmitry Lifshitz | 1f182e1 | 2016-12-28 18:28:35 +0200 | [diff] [blame] | 91 | #define CONFIG_SYS_RX_ETH_BUFFER 64 |
| 92 | #define PHY_ANEG_TIMEOUT 8000 |
| 93 | |
| 94 | #define CONFIG_BOOTP_DNS |
| 95 | #define CONFIG_BOOTP_DNS2 |
| 96 | #define CONFIG_BOOTP_SUBNETMASK |
| 97 | #define CONFIG_NET_RETRY_COUNT 10 |
| 98 | |
Uri Mashiach | 30a6712 | 2016-12-28 18:28:36 +0200 | [diff] [blame] | 99 | /* Default environment */ |
| 100 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 101 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 102 | DEFAULT_LINUX_BOOT_ENV \ |
| 103 | "autoload=no\0" \ |
| 104 | "baudrate=115200\0" \ |
| 105 | "console=ttyO2,115200n8\0" \ |
| 106 | "bootdelay=3\0" \ |
| 107 | "fdtfile=am57xx-sbc-am57x.dtb\0" \ |
| 108 | "kernel=zImage-cl-som-am57x\0" \ |
| 109 | "bootscr=bootscr.img\0" \ |
| 110 | "displaytype=hdmi\0" \ |
| 111 | "bootkernel=bootz ${loadaddr} - ${fdtaddr}\0" \ |
| 112 | "mmcloadfdt=load mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \ |
| 113 | "mmcloadkernel=load mmc ${mmcdev} ${loadaddr} ${kernel}\0" \ |
Uri Mashiach | 20a74f3 | 2017-05-17 17:29:28 +0300 | [diff] [blame] | 114 | "emmcloadfdt=load mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \ |
| 115 | "emmcloadkernel=load mmc ${mmcdev} ${loadaddr} ${kernel}\0" \ |
Uri Mashiach | 30a6712 | 2016-12-28 18:28:36 +0200 | [diff] [blame] | 116 | "load_mmc=mmc dev ${mmcdev} && mmc rescan && " \ |
Uri Mashiach | 20a74f3 | 2017-05-17 17:29:28 +0300 | [diff] [blame] | 117 | "run mmcloadkernel && run mmcloadfdt\0" \ |
Uri Mashiach | 30a6712 | 2016-12-28 18:28:36 +0200 | [diff] [blame] | 118 | "mmcroot=/dev/mmcblk1p2\0" \ |
| 119 | "mmcrootfstype=ext4 rw rootwait\0" \ |
| 120 | "mmcargs=setenv bootargs console=${console} root=${mmcroot} " \ |
| 121 | "rootfstype=${mmcrootfstype}\0" \ |
| 122 | "mmcbootscript=setenv mmcdev 0; mmc dev ${mmcdev} && mmc rescan && " \ |
| 123 | "load mmc ${mmcdev} ${loadaddr} ${bootscr} && " \ |
| 124 | "echo Running bootscript from MMC/SD Card ... && " \ |
| 125 | "source ${loadaddr}\0" \ |
| 126 | "mmcboot=setenv mmcdev 0 && run load_mmc && " \ |
| 127 | "run mmcargs && echo Booting from MMC/SD Card ... && " \ |
| 128 | "run bootkernel\0" \ |
| 129 | "emmcroot=/dev/mmcblk0p2\0" \ |
| 130 | "emmcrootfstype=ext4 rw rootwait\0" \ |
| 131 | "emmcargs=setenv bootargs console=${console} " \ |
| 132 | "root=${emmcroot} " \ |
| 133 | "rootfstype=${emmcrootfstype}\0" \ |
| 134 | "emmcbootscript=setenv mmcdev 1; mmc dev ${mmcdev} && mmc rescan && " \ |
| 135 | "load mmc ${mmcdev} ${loadaddr} ${bootscr} && " \ |
| 136 | "echo Running bootscript from eMMC ... && " \ |
| 137 | "source ${loadaddr}\0" \ |
| 138 | "emmcboot=setenv mmcdev 1 && run load_mmc && " \ |
| 139 | "run emmcargs && echo Booting from eMMC ... && " \ |
| 140 | "run bootkernel\0" \ |
| 141 | "sataroot=/dev/sda2\0" \ |
| 142 | "satarootfstype=ext4 rw rootwait\0" \ |
| 143 | "load_sata=load scsi 0 ${loadaddr} ${kernel} && " \ |
| 144 | "load scsi 0 ${fdtaddr} ${fdtfile}\0" \ |
| 145 | "sataargs=setenv bootargs console=${console} " \ |
| 146 | "root=${sataroot} " \ |
| 147 | "rootfstype=${satarootfstype}\0" \ |
| 148 | "satabootscript=load scsi 0 ${loadaddr} ${bootscr} && " \ |
| 149 | "echo Running bootscript from SATA ... && " \ |
| 150 | "source ${loadaddr}\0" \ |
| 151 | "sataboot=run load_sata && run sataargs && " \ |
| 152 | "echo Booting from SATA ... && " \ |
Uri Mashiach | 20a74f3 | 2017-05-17 17:29:28 +0300 | [diff] [blame] | 153 | "run bootkernel\0" |
Uri Mashiach | 30a6712 | 2016-12-28 18:28:36 +0200 | [diff] [blame] | 154 | |
| 155 | #undef CONFIG_BOOTCOMMAND |
| 156 | #define CONFIG_BOOTCOMMAND \ |
| 157 | "run mmcbootscript || run mmcboot || " \ |
| 158 | "run satabootscript || run sataboot || " \ |
| 159 | "run emmcbootscript || run emmcboot" |
| 160 | |
| 161 | |
Dmitry Lifshitz | 10a59d0 | 2016-12-28 18:28:33 +0200 | [diff] [blame] | 162 | #endif /* __CONFIG_CL_SOM_AM57X_H */ |