Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Grinn - http://grinn-global.com/ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __CONFIG_CHILIBOARD_H |
| 7 | #define __CONFIG_CHILIBOARD_H |
| 8 | |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 9 | #include <configs/ti_am335x_common.h> |
| 10 | |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 11 | /* Clock Defines */ |
| 12 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 13 | #define V_SCLK (V_OSCK) |
| 14 | |
| 15 | #define NANDARGS \ |
Tom Rini | 5ad8e11 | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 16 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 17 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 18 | "nandargs=setenv bootargs console=${console} ${optargs} " \ |
| 19 | "${mtdparts} " \ |
| 20 | "root=${nandroot} " \ |
| 21 | "rootfstype=${nandrootfstype}\0" \ |
| 22 | "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system\0" \ |
Michael Trimarchi | 034d8ff | 2022-05-22 15:22:08 +0200 | [diff] [blame] | 23 | "nandrootfstype=ubifs rootwait\0" \ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 24 | "nandboot=echo Booting from nand ...; " \ |
| 25 | "run nandargs; " \ |
| 26 | "nand read ${fdt_addr} NAND.u-boot-spl-os; " \ |
| 27 | "nand read ${loadaddr} NAND.kernel; " \ |
| 28 | "bootz ${loadaddr} - ${fdt_addr}\0" |
| 29 | |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 30 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 31 | "loadaddr=0x82000000\0" \ |
| 32 | "fdt_addr=0x87800000\0" \ |
| 33 | "boot_fdt=try\0" \ |
| 34 | "console=ttyO0,115200n8\0" \ |
| 35 | "image=zImage\0" \ |
Michal Oleszczyk | 49bc147 | 2017-10-17 14:06:33 +0200 | [diff] [blame] | 36 | "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 37 | "ip_dyn=yes\0" \ |
| 38 | "optargs=\0" \ |
| 39 | "loadbootscript=" \ |
| 40 | "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 41 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 42 | "source\0" \ |
| 43 | "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 44 | "${boot_dir}/${image}\0" \ |
| 45 | "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} " \ |
| 46 | "${boot_dir}/${fdt_file}\0" \ |
| 47 | "mmcdev=0\0" \ |
| 48 | "mmcpart=1\0" \ |
| 49 | "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ |
| 50 | "mmcargs=setenv bootargs console=${console},${baudrate} ${optargs} " \ |
| 51 | "${mtdparts} " \ |
| 52 | "root=${mmcroot}\0" \ |
| 53 | "mmcloados=run mmcargs; " \ |
| 54 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 55 | "if run loadfdt; then " \ |
| 56 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 57 | "else " \ |
| 58 | "if test ${boot_fdt} = try; then " \ |
| 59 | "bootz; " \ |
| 60 | "else " \ |
| 61 | "echo WARN: Cannot load the DT; " \ |
| 62 | "fi; " \ |
| 63 | "fi; " \ |
| 64 | "else " \ |
| 65 | "bootz; " \ |
| 66 | "fi;\0" \ |
| 67 | "mmcboot=mmc dev ${mmcdev}; " \ |
| 68 | "if mmc rescan; then " \ |
| 69 | "echo SD/MMC found on device ${mmcdev};" \ |
| 70 | "if run loadimage; then " \ |
| 71 | "run mmcloados;" \ |
| 72 | "fi;" \ |
| 73 | "fi;\0" \ |
| 74 | "netargs=setenv bootargs console=${console},${baudrate} ${optargs} " \ |
| 75 | "${mtdparts} " \ |
| 76 | "root=/dev/nfs " \ |
| 77 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 78 | "netboot=echo Booting from net ...; " \ |
| 79 | "run netargs; " \ |
| 80 | "if test ${ip_dyn} = yes; then " \ |
| 81 | "setenv get_cmd dhcp; " \ |
| 82 | "else " \ |
| 83 | "setenv get_cmd tftp; " \ |
| 84 | "fi; " \ |
| 85 | "${get_cmd} ${image}; " \ |
| 86 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 87 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 88 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 89 | "else " \ |
| 90 | "if test ${boot_fdt} = try; then " \ |
| 91 | "bootz; " \ |
| 92 | "else " \ |
| 93 | "echo WARN: Cannot load the DT; " \ |
| 94 | "fi; " \ |
| 95 | "fi; " \ |
| 96 | "else " \ |
| 97 | "bootz; " \ |
| 98 | "fi;\0" \ |
| 99 | NANDARGS |
| 100 | |
| 101 | /* NS16550 Configuration */ |
| 102 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */ |
| 103 | #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */ |
| 104 | #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */ |
| 105 | #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */ |
| 106 | #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */ |
| 107 | #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 108 | |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 109 | /* SPL */ |
| 110 | /* Bootcount using the RTC block */ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 111 | #define CONFIG_SYS_BOOTCOUNT_BE |
| 112 | |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 113 | /* NAND: device related configs */ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 114 | /* NAND: driver related configs */ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 115 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
| 116 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 117 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 118 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 119 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 120 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 121 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 122 | |
| 123 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 124 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 125 | |
| 126 | #if defined(CONFIG_ENV_IS_IN_NAND) |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 127 | #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 128 | #endif |
| 129 | |
| 130 | /* Network. */ |
Marcin Niestroj | 20315d2 | 2017-01-25 09:53:08 +0100 | [diff] [blame] | 131 | |
| 132 | #endif /* ! __CONFIG_CHILIBOARD_H */ |