Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 2 | /* |
| 3 | * K+P iMX6Q KP_IMX6Q_TPC board configuration |
| 4 | * |
| 5 | * Copyright (C) 2018 Lukasz Majewski <lukma@denx.de> |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __KP_IMX6Q_TPC_IMX6_CONFIG_H_ |
| 9 | #define __KP_IMX6Q_TPC_IMX6_CONFIG_H_ |
| 10 | |
| 11 | #include <asm/arch/imx-regs.h> |
| 12 | |
| 13 | #include "mx6_common.h" |
| 14 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 15 | /* Miscellaneous configurable options */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 16 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 17 | /* FEC ethernet */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 18 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 19 | /* USB Configs */ |
| 20 | #ifdef CONFIG_CMD_USB |
Tom Rini | b9796e8 | 2022-12-04 10:04:56 -0500 | [diff] [blame] | 21 | #define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 22 | #define CFG_MXC_USB_FLAGS 0 |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 23 | #endif |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 24 | |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 25 | #define CFG_EXTRA_ENV_SETTINGS \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 26 | "console=ttymxc0,115200\0" \ |
| 27 | "fdt_addr=0x18000000\0" \ |
| 28 | "fdt_high=0xffffffff\0" \ |
| 29 | "initrd_high=0xffffffff\0" \ |
| 30 | "kernel_addr_r=0x10008000\0" \ |
| 31 | "fdt_addr_r=0x13000000\0" \ |
| 32 | "ramdisk_addr_r=0x18000000\0" \ |
| 33 | "scriptaddr=0x14000000\0" \ |
| 34 | "kernel_file=fitImage\0"\ |
| 35 | "rdinit=/sbin/init\0" \ |
| 36 | "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \ |
| 37 | "fit_config=mx6q_tpc70_conf\0" \ |
Lukasz Majewski | ab875e8 | 2019-10-10 16:11:22 +0200 | [diff] [blame] | 38 | "uboot_file=u-boot.img\0" \ |
| 39 | "SPL_file=SPL\0" \ |
| 40 | "wic_file=kp-image-kpimx6qtpc.wic\0" \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 41 | "upd_image=st.4k\0" \ |
Lukasz Majewski | 3272eaa | 2019-10-10 16:11:30 +0200 | [diff] [blame] | 42 | "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \ |
| 43 | "initrd_ram_dev=/dev/ram\0" \ |
| 44 | "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 45 | "loadusb=usb start; " \ |
| 46 | "fatload usb 0 ${loadaddr} ${upd_image}\0" \ |
Lukasz Majewski | ab875e8 | 2019-10-10 16:11:22 +0200 | [diff] [blame] | 47 | "upd_uboot_sd=" \ |
| 48 | "if tftp ${loadaddr} ${uboot_file}; then " \ |
| 49 | "setexpr blkc ${filesize} / 0x200;" \ |
| 50 | "setexpr blkc ${blkc} + 1;" \ |
| 51 | "mmc write ${loadaddr} 0x8A ${blkc};" \ |
| 52 | "fi;\0" \ |
| 53 | "upd_SPL_sd=" \ |
| 54 | "if tftp ${loadaddr} ${SPL_file}; then " \ |
| 55 | "setexpr blkc ${filesize} / 0x200;" \ |
| 56 | "setexpr blkc ${blkc} + 1;" \ |
| 57 | "mmc write ${loadaddr} 0x2 ${blkc};" \ |
| 58 | "fi;\0" \ |
Lukasz Majewski | 1181e4a | 2019-10-10 16:11:23 +0200 | [diff] [blame] | 59 | "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \ |
| 60 | "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \ |
| 61 | "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \ |
| 62 | "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \ |
Lukasz Majewski | ab875e8 | 2019-10-10 16:11:22 +0200 | [diff] [blame] | 63 | "upd_wic=" \ |
| 64 | "if tftp ${loadaddr} ${wic_file}; then " \ |
| 65 | "setexpr blkc ${filesize} / 0x200;" \ |
| 66 | "setexpr blkc ${blkc} + 1;" \ |
| 67 | "mmc write ${loadaddr} 0x0 ${blkc};" \ |
| 68 | "fi;\0" \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 69 | "usbupd=echo Booting update from usb ...; " \ |
| 70 | "setenv bootargs; " \ |
| 71 | "run updargs; " \ |
Lukasz Majewski | 3272eaa | 2019-10-10 16:11:30 +0200 | [diff] [blame] | 72 | "run addinitrd; " \ |
| 73 | "run addswupdate; " \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 74 | "run loadusb; " \ |
| 75 | "bootm ${loadaddr}#${fit_config}\0" \ |
| 76 | BOOTENV |
| 77 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 78 | #define BOOT_TARGET_DEVICES(func) \ |
| 79 | func(MMC, mmc, 0) \ |
| 80 | func(MMC, mmc, 1) \ |
| 81 | func(USB, usb, 0) \ |
| 82 | func(DHCP, dhcp, na) |
| 83 | |
| 84 | #include <config_distro_bootcmd.h> |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 85 | |
| 86 | /* Physical Memory Map */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 87 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 88 | |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 89 | #define CFG_SYS_SDRAM_BASE PHYS_SDRAM |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 90 | #define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 91 | #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 92 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 93 | /* Environment */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 94 | |
| 95 | #endif /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */ |