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