271 lines
8.0 KiB
C
271 lines
8.0 KiB
C
/*
|
|
* am335x_nmhw21.h
|
|
*
|
|
* Copyright (C) 2018 NetModule AG - http://www.netmodule.com/
|
|
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation version 2.
|
|
*
|
|
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
|
|
* kind, whether express or implied; without even the implied warranty
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef __CONFIG_AM335X_NMHW21_H
|
|
#define __CONFIG_AM335X_NMHW21_H
|
|
|
|
#include <configs/ti_am335x_common.h>
|
|
|
|
#undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
|
|
|
|
#undef CONFIG_HW_WATCHDOG
|
|
#undef CONFIG_OMPAP_WATCHDOG
|
|
#undef CONFIG_SPL_WATCHDOG_SUPPORT
|
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
# define CONFIG_TIMESTAMP
|
|
# define CONFIG_LZO
|
|
#endif
|
|
|
|
#define CONFIG_SYS_BOOTM_LEN (16 << 20)
|
|
|
|
#define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
|
|
#define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
|
|
#define CONFIG_BOARD_LATE_INIT
|
|
|
|
/* Clock Defines */
|
|
#define V_OSCK 0 /* 0 means detect from sysboot1 config */
|
|
#define V_SCLK (V_OSCK)
|
|
|
|
#include <config_distro_bootcmd.h>
|
|
|
|
/* Dynamic override for PHY_ANEG_TIMEOUT value */
|
|
#ifndef CONFIG_SPL_BUILD
|
|
# ifndef __ASSEMBLER__
|
|
int eth_phy_timeout(void);
|
|
# endif
|
|
#endif
|
|
#define PHY_ANEG_TIMEOUT eth_phy_timeout()
|
|
#define PHY_ANEG_DEFAULT_TIMEOUT 5000
|
|
|
|
#define CONFIG_ARP_TIMEOUT 200
|
|
#undef CONFIG_NET_RETRY_COUNT
|
|
#define CONFIG_NET_RETRY_COUNT 5
|
|
#define CONFIG_BOOTP_MAY_FAIL
|
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
|
|
|
|
/*
|
|
Memory map:
|
|
|
|
0x80000000 KERNEL_ADDR
|
|
+63MB
|
|
0x83F00000 FDT_ADDR
|
|
+1MB
|
|
0x84000000 OT_RD_ADDR
|
|
+126MB
|
|
0x8BE00000 PXE_ADDR
|
|
+2MB
|
|
0x8C000000 LOAD_ADDR
|
|
+1MB
|
|
0x8C100000 OT_KERNEL_ADDR
|
|
+63MB
|
|
0x90000000 256 MB
|
|
|
|
*/
|
|
|
|
#define KERNEL_ADDR "0x80000000"
|
|
#define FDT_ADDR "0x83F00000"
|
|
#define OT_RD_ADDR "0x84000000"
|
|
#define PXE_ADDR "0x8BE00000"
|
|
#define LOAD_ADDR "0x8C000000"
|
|
#define OT_KERNEL_ADDR "0x8C100000"
|
|
|
|
/* If this is set, the initrd will not be copyed to a high_addr when booting but used from OT_KERNEL_ADDR */
|
|
#define INITRD_HIGH_ADDR "0xffffffff"
|
|
|
|
/* If this is set, the fdt will not be copyed to a high_addr when booting but used from FDT_ADDR */
|
|
#define FDT_HIGH_ADDR "0xffffffff"
|
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
|
"kernel_image=zImage\0" \
|
|
"fdt_image=am335x-nmhw21-prod1.dtb\0"\
|
|
"fdt_addr_r=" FDT_ADDR "\0" \
|
|
"fdt_high=" FDT_HIGH_ADDR "\0" \
|
|
"initrd_high=" INITRD_HIGH_ADDR "\0" \
|
|
"kernel_addr=" KERNEL_ADDR "\0" \
|
|
"kernel_addr_r=" OT_KERNEL_ADDR "\0" \
|
|
"load_addr=" LOAD_ADDR "\0" \
|
|
"pxefile_addr_r=" PXE_ADDR "\0" \
|
|
"ramdisk_addr_r=" OT_RD_ADDR "\0" \
|
|
"defaultconsole=ttyS2\0" /* Default output console */ \
|
|
"fdt_skip_update=yes\0" \
|
|
"ethprime=cpsw\0" \
|
|
"bootcmd_otenv=ext4load mmc 1:1 $load_addr /boot/loader/uEnv.txt; " \
|
|
"env import -t $load_addr $filesize; " \
|
|
"setenv bootargs $bootargs root=/dev/ram0 console=$defaultconsole,115200 ti_cpsw.rx_packet_max=1526 rw ostree_root=/dev/mmcblk1p1\0" \
|
|
"bootcmd_rd_in_mmc=ext4load mmc 1:1 $kernel_addr_r /boot$kernel_image; " \
|
|
"ext4load mmc 1:1 $ramdisk_addr_r /boot$ramdisk_image; " \
|
|
"bootm $kernel_addr_r $ramdisk_addr_r\0" \
|
|
"bootcmd=run bootcmd_otenv; run bootcmd_rd_in_mmc\0" \
|
|
"bootdelay=0\0" \
|
|
"ipaddr=192.168.1.1\0" \
|
|
"serverip=192.168.1.254\0" \
|
|
"tftptimeout=2000\0" \
|
|
"tftptimeoutcountmax=5\0" \
|
|
"bootpretryperiod=5000\0" \
|
|
"autoload=false\0" \
|
|
"tftp_recovery=tftpboot $kernel_addr recovery-image; tftpboot $fdt_addr_r recovery-dtb; " \
|
|
"setenv bootargs rdinit=/etc/preinit console=$defaultconsole,115200 " \
|
|
"debug ti_cpsw.rx_packet_max=1526; " \
|
|
"bootz $kernel_addr - $fdt_addr_r\0" \
|
|
"pxe_recovery=sleep 3 && dhcp && pxe get && pxe boot\0" \
|
|
"recovery=run pxe_recovery || setenv ipaddr $ipaddr; setenv serverip $serverip; run tftp_recovery\0" \
|
|
/* setenv ipaddr and serverip is necessary, because dhclient can destroy the IPs internally */
|
|
#endif
|
|
#define CONFIG_ZERO_BOOTDELAY_CHECK
|
|
/* UART Configuration */
|
|
#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0: XModem Boot */
|
|
#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1: See note below */
|
|
#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2: eMMC Boot, User UART */
|
|
/* NOTE: NS16550 definitions are cumulative, need to set COM2 to have COM3 */
|
|
|
|
#define CONFIG_I2C
|
|
#define CONFIG_I2C_MULTI_BUS
|
|
|
|
/* TODO: Check I2C Bus for EEPROM */
|
|
#define CONFIG_CMD_EEPROM
|
|
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
|
|
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
|
|
#define CONFIG_SYS_I2C_SPEED 100000
|
|
#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
|
|
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 50 /* TODO: Can this be reduced to 20ms */
|
|
|
|
#define CONFIG_PCA953X
|
|
#define CONFIG_SYS_I2C_PCA953X_BUS 1
|
|
#define CONFIG_SYS_I2C_PCA953X_ADDR 0x74
|
|
#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x74, 16} }
|
|
#define CONFIG_CMD_PCA953X
|
|
#define CONFIG_CMD_PCA953X_INFO
|
|
|
|
|
|
/* Put Environment in eMMC */
|
|
#define CONFIG_ENV_OFFSET (512 * 128) /* @ 512*256 SPL starts */
|
|
#define CONFIG_ENV_SIZE (4 * 1024)
|
|
#define CONFIG_ENV_IS_IN_MMC
|
|
#define CONFIG_SYS_MMC_ENV_DEV 1
|
|
|
|
#if 0
|
|
#define CONFIG_SYS_MMC_ENV_PART 2
|
|
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
|
|
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
|
|
#endif
|
|
|
|
|
|
#undef CONFIG_SPL_ENV_SUPPORT
|
|
#undef CONFIG_SPL_NAND_SUPPORT
|
|
#undef CONFIG_SPL_ONENAND_SUPPORT
|
|
|
|
/* We need to disable SPI to not confuse the eeprom env driver */
|
|
/* TODO: Double check */
|
|
|
|
/* SPI IP Block */
|
|
#define CONFIG_OMAP3_SPI /* Already define in ti_armv7_omap.h, included by ti_am335x_common.h */
|
|
#define CONFIG_SJA1105_SPI_BUS 1 /* bus 1 = spi1 = McSPI2 */
|
|
#define CONFIG_SJA1105_SPI_CS 1 /* SJA1105 uses CS1~ */
|
|
|
|
#undef CONFIG_SPI
|
|
#undef CONFIG_SPI_BOOT
|
|
#undef CONFIG_SPL_OS_BOOT
|
|
|
|
#define CONFIG_SPL_POWER_SUPPORT /* TODO: Check */
|
|
#define CONFIG_SPL_YMODEM_SUPPORT
|
|
|
|
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
|
|
|
|
#define CONFIG_SUPPORT_EMMC_BOOT
|
|
|
|
/*
|
|
* USB configuration. We enable MUSB support, both for host and for
|
|
* gadget. We set USB0 as peripheral and USB1 as host, based on the
|
|
* board schematic and physical port wired to each. Then for host we
|
|
* add mass storage support and for gadget we add both RNDIS ethernet
|
|
* and DFU.
|
|
*/
|
|
#define CONFIG_USB_MUSB_DSPS
|
|
#define CONFIG_ARCH_MISC_INIT
|
|
#define CONFIG_USB_MUSB_PIO_ONLY
|
|
#define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
|
|
#define CONFIG_AM335X_USB0
|
|
#define CONFIG_AM335X_USB0_MODE MUSB_HOST
|
|
|
|
/* Fastboot */
|
|
#define CONFIG_USB_FUNCTION_FASTBOOT
|
|
#define CONFIG_CMD_FASTBOOT
|
|
#define CONFIG_ANDROID_BOOT_IMAGE
|
|
#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
|
|
#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
|
|
/* TODO: Check */
|
|
|
|
/* To support eMMC booting */
|
|
#define CONFIG_STORAGE_EMMC
|
|
#define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
|
|
|
|
#ifdef CONFIG_USB_MUSB_HOST
|
|
#define CONFIG_USB_STORAGE
|
|
#endif
|
|
|
|
#ifdef CONFIG_USB_MUSB_GADGET
|
|
/* Removing USB gadget and can be enabled adter adding support usb DM */
|
|
#ifndef CONFIG_DM_ETH
|
|
#define CONFIG_USB_ETHER
|
|
#define CONFIG_USB_ETH_RNDIS
|
|
#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
|
|
#endif /* CONFIG_DM_ETH */
|
|
#endif /* CONFIG_USB_MUSB_GADGET */
|
|
|
|
|
|
/*
|
|
* Disable MMC DM for SPL build and can be re-enabled after adding
|
|
* DM support in SPL
|
|
*/
|
|
#ifdef CONFIG_SPL_BUILD
|
|
#undef CONFIG_DM_MMC
|
|
#undef CONFIG_TIMER
|
|
#endif
|
|
|
|
#if defined(CONFIG_SPL_BUILD)
|
|
/* Remove other SPL modes. */
|
|
#undef CONFIG_SPL_NAND_SUPPORT
|
|
#define CONFIG_ENV_IS_NOWHERE
|
|
#undef CONFIG_PARTITION_UUIDS
|
|
#undef CONFIG_EFI_PARTITION
|
|
#endif
|
|
|
|
/* Network. */
|
|
#define CONFIG_PHYLIB
|
|
#define CONFIG_PHY_SMSC
|
|
|
|
#define CONFIG_CMD_MEMTEST
|
|
#define CONFIG_SYS_MEMTEST_START 0x84000000
|
|
#define CONFIG_SYS_MEMTEST_END 0x87900000
|
|
|
|
#define CONFIG_CMD_PXE
|
|
|
|
#define CONFIG_OF_BOARD_SETUP
|
|
|
|
#define CONFIG_JTAG_MARKER_SPL 0x402FFF00
|
|
#define CONFIG_JTAG_MARKER_UBOOT 0x807FFF00
|
|
|
|
/* SPL command is not needed */
|
|
#undef CONFIG_CMD_SPL
|
|
|
|
/* Never enable ISO it is broken and can lead to a crash */
|
|
#undef CONFIG_ISO_PARTITION
|
|
|
|
#endif /* ! __CONFIG_AM335X_NMHW21_H */
|