Hannes Schmelzer | c04ac5b | 2019-07-17 14:29:53 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Config file for BuR BRPP2_IMX6 board |
| 4 | * |
| 5 | * Copyright (C) 2018 |
| 6 | * B&R Industrial Automation GmbH - http://www.br-automation.com/ |
| 7 | */ |
| 8 | #ifndef __CONFIG_BRPP2_IMX6_H |
| 9 | #define __CONFIG_BRPP2_IMX6_H |
| 10 | |
| 11 | #include <configs/bur_cfg_common.h> |
| 12 | #include <asm/arch/imx-regs.h> |
| 13 | |
| 14 | /* -- i.mx6 specifica -- */ |
| 15 | #ifndef CONFIG_SYS_L2CACHE_OFF |
| 16 | #define CONFIG_SYS_L2_PL310 |
| 17 | #define CONFIG_SYS_PL310_BASE L2_PL310_BASE |
| 18 | #endif /* !CONFIG_SYS_L2CACHE_OFF */ |
| 19 | |
| 20 | #define CONFIG_BOARD_POSTCLK_INIT |
| 21 | #define CONFIG_MXC_GPT_HCLK |
| 22 | |
| 23 | #define CONFIG_LOADADDR 0x10700000 |
| 24 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 25 | |
| 26 | /* MMC */ |
| 27 | #define CONFIG_FSL_USDHC |
| 28 | |
| 29 | /* Boot */ |
| 30 | #define CONFIG_CMDLINE_TAG |
| 31 | #define CONFIG_SETUP_MEMORY_TAGS |
| 32 | #define CONFIG_INITRD_TAG |
| 33 | #define CONFIG_MACH_TYPE 0xFFFFFFFF |
| 34 | |
| 35 | /* misc */ |
| 36 | #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) |
| 37 | |
| 38 | /* Environment */ |
| 39 | #define CONFIG_ENV_OVERWRITE |
Hannes Schmelzer | c04ac5b | 2019-07-17 14:29:53 +0200 | [diff] [blame] | 40 | |
| 41 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 42 | BUR_COMMON_ENV \ |
| 43 | "autoload=0\0" \ |
| 44 | "cfgaddr=0x106F0000\0" \ |
| 45 | "scraddr=0x10700000\0" \ |
| 46 | "loadaddr=0x10800000\0" \ |
| 47 | "dtbaddr=0x12000000\0" \ |
| 48 | "ramaddr=0x12100000\0" \ |
| 49 | "cfgscr=mw ${loadaddr} 0 128\0" \ |
| 50 | "cfgscrl=fdt addr ${dtbaddr} &&"\ |
| 51 | " sf probe; sf read ${cfgaddr} 0x40000 0x10000 && source ${cfgaddr}\0" \ |
| 52 | "console=ttymxc0,115200n8 consoleblank=0 quiet\0" \ |
| 53 | "t50args#0=setenv bootargs b_mode=${b_mode} console=${console} " \ |
| 54 | " root=/dev/mmcblk0p2 rootfstype=ext4 rootwait panic=2 \0" \ |
| 55 | "b_t50lgcy#0=" \ |
| 56 | "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \ |
| 57 | "load ${loaddev}:2 ${dtbaddr} /boot/imx6dl-brppt50.dtb; " \ |
| 58 | "run t50args#0; run cfgscrl; bootz ${loadaddr} - ${dtbaddr}\0" \ |
| 59 | "t50args#1=setenv bootargs console=${console} b_mode=${b_mode}" \ |
| 60 | " rootwait panic=2\0" \ |
| 61 | "b_t50lgcy#1=" \ |
| 62 | "load ${loaddev}:1 ${loadaddr} zImage && " \ |
| 63 | "load ${loaddev}:1 ${dtbaddr} imx6dl-brppt50.dtb && " \ |
| 64 | "load ${loaddev}:1 ${ramaddr} rootfsPPT50.uboot && " \ |
| 65 | "run t50args#1; run cfgscrl; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0"\ |
| 66 | "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 67 | "b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \ |
| 68 | "b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 69 | "b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \ |
| 70 | "b_tgts_std=mmc0 mmc1 t50lgcy#0 t50lgcy#1 usb0 net\0" \ |
| 71 | "b_tgts_rcy=t50lgcy#1 usb0 net\0" \ |
| 72 | "b_tgts_pme=net usb0 mmc0 mmc1\0" \ |
| 73 | "b_mode=4\0" \ |
| 74 | "b_break=0\0" \ |
| 75 | "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ |
| 76 | " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ |
| 77 | " else setenv b_tgts ${b_tgts_std}; fi\0" \ |
| 78 | "b_default=run b_deftgts; for target in ${b_tgts};"\ |
| 79 | " do echo \"### booting ${target} ###\"; run b_${target};" \ |
| 80 | " if test ${b_break} = 1; then; exit; fi; done\0" \ |
| 81 | "loaddev=mmc 0\0" \ |
| 82 | "altbootcmd=setenv b_mode 0; run b_default;\0" \ |
| 83 | "bootlimit=1\0" \ |
| 84 | "net2nor=sf probe && dhcp &&" \ |
| 85 | " tftp ${loadaddr} SPL && sf erase 0 +${filesize} &&" \ |
| 86 | " sf write ${loadaddr} 400 ${filesize} &&" \ |
| 87 | " tftp ${loadaddr} u-boot-dtb.img && sf erase 0x100000 +${filesize} &&" \ |
| 88 | " sf write ${loadaddr} 0x100000 ${filesize}\0" |
| 89 | |
| 90 | /* RAM */ |
| 91 | #define PHYS_SDRAM_1 MMDC0_ARB_BASE_ADDR |
| 92 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
Hannes Schmelzer | c04ac5b | 2019-07-17 14:29:53 +0200 | [diff] [blame] | 93 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 94 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 95 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 96 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 97 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 98 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 99 | |
| 100 | /* Ethernet */ |
| 101 | #define CONFIG_MII |
| 102 | #define CONFIG_FEC_XCV_TYPE RGMII |
| 103 | #define CONFIG_FEC_FIXED_SPEED _1000BASET |
| 104 | #define CONFIG_ARP_TIMEOUT 1500UL |
| 105 | |
| 106 | /* USB Configs */ |
| 107 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 108 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 109 | |
| 110 | /* SPL */ |
| 111 | #ifdef CONFIG_SPL |
| 112 | #include "imx6_spl.h" |
| 113 | |
| 114 | #endif /* CONFIG_SPL */ |
| 115 | #endif /* __CONFIG_BRPP2_IMX6_H */ |