Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 |
| 4 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 5 | * |
| 6 | * Based on: |
| 7 | * am335x_evm.h |
| 8 | * |
| 9 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef __CONFIG_AM335X_SHC_H |
| 13 | #define __CONFIG_AM335X_SHC_H |
| 14 | |
| 15 | #include <configs/ti_am335x_common.h> |
| 16 | |
| 17 | /* settings we don;t want on this board */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 18 | |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 19 | /* Clock Defines */ |
| 20 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 21 | #define V_SCLK (V_OSCK) |
| 22 | |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 23 | #define CONFIG_HSMMC2_8BIT |
| 24 | |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 25 | #ifndef CONFIG_SPL_BUILD |
| 26 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 27 | "loadaddr=0x80200000\0" \ |
| 28 | "kloadaddr=0x84000000\0" \ |
| 29 | "fdtaddr=0x85000000\0" \ |
| 30 | "fdt_high=0xffffffff\0" \ |
| 31 | "rdaddr=0x81000000\0" \ |
| 32 | "bootfile=uImage\0" \ |
| 33 | "fdtfile=am335x-shc.dtb\0" \ |
| 34 | "verify=no\0" \ |
| 35 | "serverip=10.55.152.184\0" \ |
| 36 | "rootpath=/srv/nfs/shc-rootfs\0" \ |
| 37 | "console=ttyO0,115200n8\0" \ |
| 38 | "optargs=quiet\0" \ |
| 39 | "mmcdev=1\0" \ |
| 40 | "harakiri=0\0" \ |
| 41 | "mmcpart=2\0" \ |
| 42 | "active_root=root1\0" \ |
| 43 | "inactive_root=root2\0" \ |
| 44 | "mmcrootfstype=ext4 rootwait\0" \ |
| 45 | "nfsopts=nolock\0" \ |
| 46 | "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ |
| 47 | "::off\0" \ |
| 48 | "ip_method=none\0" \ |
| 49 | "bootargs_defaults=setenv bootargs " \ |
| 50 | "console=${console} " \ |
| 51 | "${optargs}\0" \ |
| 52 | "mmcargs=run bootargs_defaults;" \ |
| 53 | "setenv bootargs ${bootargs} " \ |
| 54 | "root=${mmcroot} " \ |
| 55 | "rootfstype=${mmcrootfstype} ip=${ip_method}\0" \ |
| 56 | "netargs=setenv bootargs console=${console} " \ |
| 57 | "${optargs} " \ |
| 58 | "root=/dev/nfs " \ |
| 59 | "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \ |
| 60 | "ip=dhcp\0" \ |
| 61 | "bootenv=uEnv.txt\0" \ |
| 62 | "loadbootenv=if fatload mmc ${mmcdev} ${loadaddr} ${bootenv}; then " \ |
| 63 | "echo Loaded environment from ${bootenv}; " \ |
| 64 | "run importbootenv; " \ |
| 65 | "fi;\0" \ |
| 66 | "importbootenv=echo Importing environment variables from uEnv.txt ...; " \ |
| 67 | "env import -t $loadaddr $filesize\0" \ |
| 68 | "loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}\0" \ |
| 69 | "loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${kloadaddr} /boot/${bootfile}\0" \ |
| 70 | "loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /boot/${fdtfile}\0" \ |
| 71 | "netloaduimage=tftp ${loadaddr} ${bootfile}\0" \ |
| 72 | "netloadfdt=tftp ${fdtaddr} ${fdtfile}\0" \ |
| 73 | "mmcboot=echo Booting Linux from ${mmcdevice} ...; " \ |
| 74 | "run mmcargs; " \ |
| 75 | "if run loadfdt; then " \ |
| 76 | "echo device tree detected; " \ |
| 77 | "bootm ${kloadaddr} - ${fdtaddr}; " \ |
| 78 | "else " \ |
| 79 | "bootm ${kloadaddr}; " \ |
| 80 | "fi; \0" \ |
| 81 | "netboot=echo Booting from network ...; " \ |
| 82 | "setenv autoload no; " \ |
| 83 | "dhcp; " \ |
| 84 | "run netloaduimage; " \ |
| 85 | "run netargs; " \ |
| 86 | "echo NFS path: ${serverip}:${rootpath};" \ |
| 87 | "if run netloadfdt; then " \ |
| 88 | "echo device tree detected; " \ |
| 89 | "bootm ${loadaddr} - ${fdtaddr}; " \ |
| 90 | "else " \ |
| 91 | "bootm ${loadaddr}; " \ |
| 92 | "fi; \0" \ |
| 93 | "emmc_erase=if test ${harakiri} = 1 ; then echo erase emmc ...; setenv mmcdev 1; mmc erase 0 200; reset; fi; \0" \ |
| 94 | "mmcpart_gp=mmcpart gp 1 40; \0" \ |
| 95 | "mmcpart_enhance=mmcpart enhance 0 64; \0" \ |
| 96 | "mmcpart_rel_write=mmcpart rel_write 1f; \0" \ |
| 97 | "mmcpart_commit=mmcpart commit 1; \0" \ |
| 98 | "mmc_hw_part=run mmcpart_gp; run mmcpart_enhance; run mmcpart_rel_write; run mmcpart_commit; \0" \ |
| 99 | "led_success=gpio set 22; \0" \ |
| 100 | "fusecmd=mmc dev 1; if mmcpart iscommitted; then echo HW Partitioning already committed; mmcpart list; else run mmc_hw_part; fi; run led_success; \0" \ |
| 101 | "uenv_exec=if test -n $uenvcmd; then " \ |
| 102 | "echo Running uenvcmd ...; " \ |
| 103 | "run uenvcmd; " \ |
| 104 | "fi;\0" \ |
| 105 | "sd_setup=echo SD/MMC-Card detected on device 0; " \ |
| 106 | "setenv mmcdevice SD; " \ |
| 107 | "setenv mmcdev 0; " \ |
| 108 | "setenv mmcpart 2; " \ |
| 109 | "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" \ |
| 110 | "emmc_setup=echo eMMC detected on device 1; " \ |
| 111 | "setenv mmcdevice eMMC; " \ |
| 112 | "setenv mmcdev 1; " \ |
| 113 | "run emmc_erase; " \ |
| 114 | "if test ${active_root} = root2; then " \ |
| 115 | "echo Active root is partition 6 (root2); " \ |
| 116 | "setenv mmcpart 6; " \ |
| 117 | "else " \ |
| 118 | "echo Active root is partition 5 (root1); " \ |
| 119 | "setenv mmcpart 5; " \ |
| 120 | "fi; " \ |
| 121 | "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart};\0" |
| 122 | #endif /* #ifndef CONFIG_SPL_BUILD */ |
| 123 | |
| 124 | #if defined CONFIG_SHC_NETBOOT |
| 125 | /* Network Boot */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 126 | |
| 127 | #elif defined CONFIG_SHC_SDBOOT /* !defined CONFIG_SHC_NETBOOT */ |
| 128 | /* SD-Card Boot */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 129 | |
| 130 | #elif defined CONFIG_SHC_ICT |
| 131 | /* ICT adapter boots only u-boot and does HW partitioning */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 132 | |
| 133 | #else /* !defined CONFIG_SHC_NETBOOT, !defined CONFIG_SHC_SDBOOT */ |
| 134 | /* Regular Boot from internal eMMC */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 135 | |
| 136 | #endif /* Regular Boot */ |
| 137 | |
| 138 | /* NS16550 Configuration */ |
Tom Rini | df6a215 | 2022-11-16 13:10:28 -0500 | [diff] [blame] | 139 | #define CFG_SYS_NS16550_COM1 0x44e09000 /* UART0 */ |
| 140 | #define CFG_SYS_NS16550_COM2 0x48022000 /* UART1 */ |
| 141 | #define CFG_SYS_NS16550_COM3 0x48024000 /* UART2 */ |
| 142 | #define CFG_SYS_NS16550_COM4 0x481a6000 /* UART3 */ |
| 143 | #define CFG_SYS_NS16550_COM5 0x481a8000 /* UART4 */ |
| 144 | #define CFG_SYS_NS16550_COM6 0x481aa000 /* UART5 */ |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 145 | |
Heiko Schocher | f116396 | 2016-06-07 08:31:25 +0200 | [diff] [blame] | 146 | #endif /* ! __CONFIG_AM335X_SHC_H */ |