Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Felix Brack | 1ba8c9e | 2018-01-23 18:27:22 +0100 | [diff] [blame] | 2 | /* |
| 3 | * pdu001.h |
| 4 | * |
| 5 | * Copyright (C) 2018 EETS GmbH - http://www.eets.ch/ |
| 6 | * |
| 7 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
Felix Brack | 1ba8c9e | 2018-01-23 18:27:22 +0100 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __CONFIG_PDU001_H |
| 11 | #define __CONFIG_PDU001_H |
| 12 | |
| 13 | #include <configs/ti_am335x_common.h> |
| 14 | |
| 15 | /* No more need for I2C legacy compatibility for this board. |
| 16 | * CONFIG_DM_I2C_COMPAT is defined in ti_armv7_common.h. See the comment there |
| 17 | * for the right moment to delete the following line. |
| 18 | */ |
| 19 | #undef CONFIG_DM_I2C_COMPAT |
| 20 | |
| 21 | /* Using 32K of volatile storage for environment */ |
| 22 | #define CONFIG_ENV_SIZE 0x4000 |
| 23 | |
| 24 | #define MACH_TYPE_PDU001 5075 |
| 25 | #define CONFIG_MACH_TYPE MACH_TYPE_PDU001 |
| 26 | #define CONFIG_BOARD_LATE_INIT |
| 27 | |
| 28 | /* Clock Defines */ |
| 29 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 30 | #define V_SCLK (V_OSCK) |
| 31 | |
| 32 | #if CONFIG_CONS_INDEX == 1 |
| 33 | #define CONSOLE_DEV "ttyO0" |
| 34 | #elif CONFIG_CONS_INDEX == 2 |
| 35 | #define CONSOLE_DEV "ttyO1" |
| 36 | #elif CONFIG_CONS_INDEX == 3 |
| 37 | #define CONSOLE_DEV "ttyO2" |
| 38 | #elif CONFIG_CONS_INDEX == 4 |
| 39 | #define CONSOLE_DEV "ttyO3" |
| 40 | #elif CONFIG_CONS_INDEX == 5 |
| 41 | #define CONSOLE_DEV "ttyO4" |
| 42 | #elif CONFIG_CONS_INDEX == 6 |
| 43 | #define CONSOLE_DEV "ttyO5" |
| 44 | #endif |
| 45 | |
| 46 | #define CONFIG_BOOTCOMMAND \ |
| 47 | "run eval_boot_device;" \ |
| 48 | "setenv bootargs console=${console} " \ |
| 49 | "vt.global_cursor_default=0 " \ |
| 50 | "root=/dev/mmcblk${mmc_boot}p${root_fs_partition} " \ |
| 51 | "rootfstype=ext4 " \ |
| 52 | "rootwait " \ |
| 53 | "rootdelay=1;" \ |
| 54 | "fatload mmc ${mmc_boot} ${fdtaddr} ${fdtfile};" \ |
| 55 | "fatload mmc ${mmc_boot} ${loadaddr} ${bootfile};" \ |
| 56 | "bootz ${loadaddr} - ${fdtaddr}" |
| 57 | |
| 58 | #ifndef CONFIG_SPL_BUILD |
| 59 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 60 | DEFAULT_LINUX_BOOT_ENV \ |
| 61 | "fdtfile=am335x-pdu001.dtb\0" \ |
| 62 | "bootfile=zImage\0" \ |
| 63 | "console=" CONSOLE_DEV ",115200n8\0" \ |
| 64 | "root_fs_partition=2\0" \ |
| 65 | "eval_boot_device=" \ |
| 66 | "if test $boot_device = emmc; then " \ |
| 67 | "setenv mmc_boot 0;" \ |
| 68 | "elif test $boot_device = sdcard; then " \ |
| 69 | "setenv mmc_boot 1;" \ |
| 70 | "else " \ |
| 71 | "echo Bootdevice is neither MMC0 nor MMC1;" \ |
| 72 | "reset;" \ |
| 73 | "fi;" \ |
| 74 | "\0" |
| 75 | #endif |
| 76 | |
| 77 | /* NS16550 Configuration */ |
| 78 | #define CONFIG_SYS_NS16550_COM1 UART0_BASE |
| 79 | #define CONFIG_SYS_NS16550_COM2 UART1_BASE |
| 80 | #define CONFIG_SYS_NS16550_COM3 UART2_BASE |
| 81 | #define CONFIG_SYS_NS16550_COM4 UART3_BASE |
| 82 | #define CONFIG_SYS_NS16550_COM5 UART4_BASE |
| 83 | #define CONFIG_SYS_NS16550_COM6 UART5_BASE |
| 84 | #define CONFIG_BAUDRATE 115200 |
| 85 | |
| 86 | #endif /* ! __CONFIG_PDU001_H */ |