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