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 | |
| 15 | /* SPL */ |
| 16 | #include "imx6_spl.h" /* common IMX6 SPL configuration */ |
| 17 | |
| 18 | /* Miscellaneous configurable options */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 19 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 20 | /* FEC ethernet */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 21 | #define CONFIG_ARP_TIMEOUT 200UL |
| 22 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 23 | /* USB Configs */ |
| 24 | #ifdef CONFIG_CMD_USB |
| 25 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 26 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 27 | #define CONFIG_MXC_USB_FLAGS 0 |
| 28 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */ |
| 29 | #endif |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 30 | |
| 31 | #ifndef CONFIG_SPL_BUILD |
| 32 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 33 | "console=ttymxc0,115200\0" \ |
| 34 | "fdt_addr=0x18000000\0" \ |
| 35 | "fdt_high=0xffffffff\0" \ |
| 36 | "initrd_high=0xffffffff\0" \ |
| 37 | "kernel_addr_r=0x10008000\0" \ |
| 38 | "fdt_addr_r=0x13000000\0" \ |
| 39 | "ramdisk_addr_r=0x18000000\0" \ |
| 40 | "scriptaddr=0x14000000\0" \ |
| 41 | "kernel_file=fitImage\0"\ |
| 42 | "rdinit=/sbin/init\0" \ |
| 43 | "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \ |
| 44 | "fit_config=mx6q_tpc70_conf\0" \ |
Lukasz Majewski | ab875e8 | 2019-10-10 16:11:22 +0200 | [diff] [blame] | 45 | "uboot_file=u-boot.img\0" \ |
| 46 | "SPL_file=SPL\0" \ |
| 47 | "wic_file=kp-image-kpimx6qtpc.wic\0" \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 48 | "upd_image=st.4k\0" \ |
Lukasz Majewski | 3272eaa | 2019-10-10 16:11:30 +0200 | [diff] [blame] | 49 | "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \ |
| 50 | "initrd_ram_dev=/dev/ram\0" \ |
| 51 | "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 52 | "loadusb=usb start; " \ |
| 53 | "fatload usb 0 ${loadaddr} ${upd_image}\0" \ |
Lukasz Majewski | ab875e8 | 2019-10-10 16:11:22 +0200 | [diff] [blame] | 54 | "upd_uboot_sd=" \ |
| 55 | "if tftp ${loadaddr} ${uboot_file}; then " \ |
| 56 | "setexpr blkc ${filesize} / 0x200;" \ |
| 57 | "setexpr blkc ${blkc} + 1;" \ |
| 58 | "mmc write ${loadaddr} 0x8A ${blkc};" \ |
| 59 | "fi;\0" \ |
| 60 | "upd_SPL_sd=" \ |
| 61 | "if tftp ${loadaddr} ${SPL_file}; then " \ |
| 62 | "setexpr blkc ${filesize} / 0x200;" \ |
| 63 | "setexpr blkc ${blkc} + 1;" \ |
| 64 | "mmc write ${loadaddr} 0x2 ${blkc};" \ |
| 65 | "fi;\0" \ |
Lukasz Majewski | 1181e4a | 2019-10-10 16:11:23 +0200 | [diff] [blame] | 66 | "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \ |
| 67 | "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \ |
| 68 | "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \ |
| 69 | "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \ |
Lukasz Majewski | ab875e8 | 2019-10-10 16:11:22 +0200 | [diff] [blame] | 70 | "upd_wic=" \ |
| 71 | "if tftp ${loadaddr} ${wic_file}; then " \ |
| 72 | "setexpr blkc ${filesize} / 0x200;" \ |
| 73 | "setexpr blkc ${blkc} + 1;" \ |
| 74 | "mmc write ${loadaddr} 0x0 ${blkc};" \ |
| 75 | "fi;\0" \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 76 | "usbupd=echo Booting update from usb ...; " \ |
| 77 | "setenv bootargs; " \ |
| 78 | "run updargs; " \ |
Lukasz Majewski | 3272eaa | 2019-10-10 16:11:30 +0200 | [diff] [blame] | 79 | "run addinitrd; " \ |
| 80 | "run addswupdate; " \ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 81 | "run loadusb; " \ |
| 82 | "bootm ${loadaddr}#${fit_config}\0" \ |
| 83 | BOOTENV |
| 84 | |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 85 | #define BOOT_TARGET_DEVICES(func) \ |
| 86 | func(MMC, mmc, 0) \ |
| 87 | func(MMC, mmc, 1) \ |
| 88 | func(USB, usb, 0) \ |
| 89 | func(DHCP, dhcp, na) |
| 90 | |
| 91 | #include <config_distro_bootcmd.h> |
| 92 | #endif |
| 93 | |
| 94 | /* Physical Memory Map */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 95 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 96 | |
| 97 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 98 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 99 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 100 | |
| 101 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 102 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 103 | |
| 104 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 105 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 106 | |
| 107 | /* Environment */ |
Lukasz Majewski | e7f7c08 | 2018-04-05 09:04:38 +0200 | [diff] [blame] | 108 | |
| 109 | #endif /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */ |