diff options
| author | Lucas Castro <lucas@gnuabordo.com.br> | 2022-06-29 10:34:55 -0300 |
|---|---|---|
| committer | Lucas Castro <lucas@gnuabordo.com.br> | 2022-06-29 10:34:55 -0300 |
| commit | 93bf26b04b7dd6a74d6cf3c2148af0541dc9f333 (patch) | |
| tree | ed500199e0bf34d08b4ca01578884e56c1866635 /board | |
Initial Commitmaster
Diffstat (limited to 'board')
14 files changed, 2866 insertions, 0 deletions
diff --git a/board/capu/beagleboneblack/linux.config b/board/capu/beagleboneblack/linux.config new file mode 100644 index 0000000..5cfe187 --- /dev/null +++ b/board/capu/beagleboneblack/linux.config @@ -0,0 +1,551 @@ +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_AUDIT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=16 +CONFIG_CGROUPS=y +CONFIG_MEMCG=y +CONFIG_MEMCG_SWAP=y +CONFIG_BLK_CGROUP=y +CONFIG_CGROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_CGROUP_PERF=y +CONFIG_NAMESPACES=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_EXPERT=y +CONFIG_SLAB=y +CONFIG_PROFILING=y +CONFIG_ARCH_MULTI_V6=y +CONFIG_POWER_AVS_OMAP=y +CONFIG_POWER_AVS_OMAP_CLASS3=y +CONFIG_OMAP_RESET_CLOCKS=y +CONFIG_ARCH_OMAP2=y +CONFIG_ARCH_OMAP3=y +CONFIG_ARCH_OMAP4=y +CONFIG_SOC_OMAP5=y +CONFIG_SOC_AM33XX=y +CONFIG_SOC_AM43XX=y +CONFIG_SOC_DRA7XX=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_ERRATA_411920=y +CONFIG_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_SECCOMP=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200" +CONFIG_KEXEC=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPUFREQ_DT=m +# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set +CONFIG_ARM_TI_CPUFREQ=y +CONFIG_CPU_IDLE=y +CONFIG_KERNEL_MODE_NEON=y +CONFIG_PM_DEBUG=y +CONFIG_ARM_CRYPTO=y +CONFIG_CRYPTO_SHA1_ARM_NEON=m +CONFIG_CRYPTO_SHA256_ARM=m +CONFIG_CRYPTO_SHA512_ARM=m +CONFIG_CRYPTO_AES_ARM=m +CONFIG_CRYPTO_AES_ARM_BS=m +CONFIG_CRYPTO_GHASH_ARM_CE=m +CONFIG_CRYPTO_CHACHA20_NEON=m +CONFIG_OPROFILE=y +CONFIG_KPROBES=y +# CONFIG_GCC_PLUGINS is not set +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_PARTITION_ADVANCED=y +CONFIG_BINFMT_MISC=y +CONFIG_CMA=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM_USER=y +CONFIG_NET_KEY=y +CONFIG_NET_KEY_MIGRATE=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +CONFIG_NETFILTER=y +CONFIG_PHONET=m +CONFIG_CAN=m +CONFIG_CAN_C_CAN=m +CONFIG_CAN_C_CAN_PLATFORM=m +CONFIG_BT=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m +CONFIG_BT_HCIBTUSB=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_NOKIA=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUART_3WIRE=y +CONFIG_BT_HCIUART_BCM=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIVHCI=m +CONFIG_BT_MRVL=m +CONFIG_BT_MRVL_SDIO=m +CONFIG_AF_RXRPC=m +CONFIG_RXKAD=y +CONFIG_CFG80211=m +CONFIG_MAC80211=m +CONFIG_PCI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_DRA7XX_EP=y +CONFIG_PCI_ENDPOINT=y +CONFIG_PCI_ENDPOINT_CONFIGFS=y +CONFIG_PCI_EPF_TEST=m +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_OMAP_OCP2SCP=y +CONFIG_CONNECTOR=m +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_OOPS=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_ONENAND=y +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_ONENAND_OMAP2=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_NAND_ECC_SW_BCH=y +CONFIG_MTD_NAND_OMAP2=y +CONFIG_MTD_NAND_OMAP_BCH=y +CONFIG_MTD_SPI_NOR=m +CONFIG_MTD_UBI=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=16384 +CONFIG_SENSORS_TSL2550=m +CONFIG_SRAM=y +CONFIG_PCI_ENDPOINT_TEST=m +CONFIG_EEPROM_AT24=m +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_ATA=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_AHCI_DM816=m +CONFIG_NETDEVICES=y +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +CONFIG_DM9000=y +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_HISILICON is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +CONFIG_KS8851=y +CONFIG_KS8851_MLL=y +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_SMC91X=y +CONFIG_SMSC911X=y +# CONFIG_NET_VENDOR_STMICRO is not set +CONFIG_TI_DAVINCI_EMAC=y +CONFIG_TI_CPSW=y +CONFIG_TI_CPTS=y +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_AT803X_PHY=y +CONFIG_DP83848_PHY=y +CONFIG_DP83867_PHY=y +CONFIG_MICREL_PHY=y +CONFIG_SMSC_PHY=y +CONFIG_PPP=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_FILTER=y +CONFIG_PPP_MPPE=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_USB_USBNET=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_QMI_WWAN=m +CONFIG_USB_CDC_PHONET=m +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_DEBUG=y +CONFIG_MWIFIEX=m +CONFIG_MWIFIEX_SDIO=m +CONFIG_MWIFIEX_USB=m +CONFIG_WL12XX=m +CONFIG_WL18XX=m +CONFIG_WLCORE_SPI=m +CONFIG_WLCORE_SDIO=m +CONFIG_INPUT_MOUSEDEV=m +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m +CONFIG_KEYBOARD_ATKBD=m +CONFIG_KEYBOARD_GPIO=m +CONFIG_KEYBOARD_MATRIX=m +CONFIG_KEYBOARD_OMAP4=m +CONFIG_KEYBOARD_TWL4030=m +# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_ATMEL_MXT=m +CONFIG_TOUCHSCREEN_EDT_FT5X06=m +CONFIG_TOUCHSCREEN_TI_AM335X_TSC=m +CONFIG_TOUCHSCREEN_PIXCIR=m +CONFIG_TOUCHSCREEN_TSC2004=m +CONFIG_TOUCHSCREEN_TSC2005=m +CONFIG_TOUCHSCREEN_TSC2007=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_CPCAP_PWRBUTTON=m +CONFIG_INPUT_TPS65218_PWRBUTTON=m +CONFIG_INPUT_TWL4030_PWRBUTTON=m +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_PALMAS_PWRBUTTON=m +CONFIG_INPUT_PWM_VIBRA=m +CONFIG_SERIO=m +# CONFIG_LEGACY_PTYS is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=32 +CONFIG_SERIAL_8250_RUNTIME_UARTS=6 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_8250_DETECT_IRQ=y +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_OMAP=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_OMAP=y +CONFIG_SERIAL_OMAP_CONSOLE=y +CONFIG_SERIAL_DEV_BUS=y +CONFIG_I2C_CHARDEV=y +CONFIG_SPI=y +CONFIG_SPI_OMAP24XX=y +CONFIG_SPI_TI_QSPI=m +CONFIG_HSI=m +CONFIG_OMAP_SSI=m +CONFIG_SSI_PROTOCOL=m +CONFIG_PINCTRL_SINGLE=y +CONFIG_DEBUG_GPIO=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_PCA953X=m +CONFIG_GPIO_PCF857X=y +CONFIG_GPIO_LP87565=y +CONFIG_GPIO_PALMAS=y +CONFIG_GPIO_TWL4030=y +CONFIG_W1=m +CONFIG_HDQ_MASTER_OMAP=m +CONFIG_POWER_AVS=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_BATTERY_BQ27XXX=m +CONFIG_CHARGER_ISP1704=m +CONFIG_CHARGER_TWL4030=m +CONFIG_CHARGER_BQ2415X=m +CONFIG_CHARGER_BQ24190=m +CONFIG_CHARGER_BQ24735=m +CONFIG_HWMON=m +CONFIG_SENSORS_GPIO_FAN=m +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_TMP102=m +CONFIG_THERMAL_GOV_FAIR_SHARE=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_CPU_THERMAL=y +CONFIG_TI_THERMAL=y +CONFIG_OMAP4_THERMAL=y +CONFIG_OMAP5_THERMAL=y +CONFIG_DRA752_THERMAL=y +CONFIG_WATCHDOG=y +CONFIG_OMAP_WATCHDOG=m +CONFIG_TWL4030_WATCHDOG=m +CONFIG_MFD_CPCAP=y +CONFIG_MFD_TI_AM335X_TSCADC=m +CONFIG_MFD_TI_LMU=m +CONFIG_MFD_PALMAS=y +CONFIG_MFD_TPS65217=y +CONFIG_MFD_TI_LP873X=y +CONFIG_MFD_TI_LP87565=y +CONFIG_MFD_TPS65218=y +CONFIG_MFD_TPS65910=y +CONFIG_TWL6040_CORE=y +CONFIG_REGULATOR_CPCAP=y +CONFIG_REGULATOR_GPIO=y +CONFIG_REGULATOR_LM363X=m +CONFIG_REGULATOR_LP872X=y +CONFIG_REGULATOR_LP873X=y +CONFIG_REGULATOR_LP87565=y +CONFIG_REGULATOR_PALMAS=y +CONFIG_REGULATOR_PBIAS=y +CONFIG_REGULATOR_TI_ABB=y +CONFIG_REGULATOR_TPS62360=m +CONFIG_REGULATOR_TPS65023=y +CONFIG_REGULATOR_TPS6507X=y +CONFIG_REGULATOR_TPS65217=y +CONFIG_REGULATOR_TPS65218=y +CONFIG_REGULATOR_TPS65910=y +CONFIG_REGULATOR_TWL4030=y +CONFIG_RC_CORE=m +CONFIG_LIRC=y +CONFIG_RC_DEVICES=y +CONFIG_IR_SPI=m +CONFIG_IR_RX51=m +CONFIG_IR_GPIO_TX=m +CONFIG_IR_PWM_TX=m +CONFIG_MEDIA_SUPPORT=m +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_CEC_SUPPORT=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_VIDEO_OMAP3=m +CONFIG_CEC_PLATFORM_DRIVERS=y +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +CONFIG_VIDEO_TVP5150=m +CONFIG_DRM=y +CONFIG_DRM_OMAP=y +CONFIG_OMAP5_DSS_HDMI=y +CONFIG_OMAP2_DSS_SDI=y +CONFIG_OMAP2_DSS_DSI=y +CONFIG_DRM_OMAP_ENCODER_OPA362=m +CONFIG_DRM_OMAP_ENCODER_TPD12S015=m +CONFIG_DRM_OMAP_CONNECTOR_HDMI=m +CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV=m +CONFIG_DRM_OMAP_PANEL_DSI_CM=m +CONFIG_DRM_TILCDC=y +CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_PANEL_LG_LB035Q02=m +CONFIG_DRM_PANEL_NEC_NL8048HL11=m +CONFIG_DRM_PANEL_SHARP_LS037V7DW01=m +CONFIG_DRM_PANEL_SONY_ACX565AKM=m +CONFIG_DRM_PANEL_TPO_TD028TTEC1=m +CONFIG_DRM_PANEL_TPO_TD043MTEA1=m +CONFIG_DRM_TI_TFP410=y +CONFIG_FIRMWARE_EDID=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y +CONFIG_FB_SIMPLE=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_PLATFORM=y +CONFIG_BACKLIGHT_GENERIC=m +CONFIG_BACKLIGHT_PWM=m +CONFIG_BACKLIGHT_PANDORA=m +CONFIG_BACKLIGHT_GPIO=m +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y +CONFIG_LOGO=y +CONFIG_SOUND=m +CONFIG_SND=m +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_VERBOSE_PRINTK=y +CONFIG_SND_DEBUG=y +CONFIG_SND_USB_AUDIO=m +CONFIG_SND_SOC=m +CONFIG_SND_SOC_DAVINCI_MCASP=m +CONFIG_SND_SOC_NOKIA_RX51=m +CONFIG_SND_SOC_OMAP3_PANDORA=m +CONFIG_SND_SOC_OMAP3_TWL4030=m +CONFIG_SND_SOC_OMAP_ABE_TWL6040=m +CONFIG_SND_SOC_OMAP_HDMI=m +CONFIG_SND_SOC_CPCAP=m +CONFIG_SND_SOC_TLV320AIC23_I2C=m +CONFIG_SND_SIMPLE_CARD=m +CONFIG_SND_AUDIO_GRAPH_CARD=m +CONFIG_HID_GENERIC=m +CONFIG_USB_HIDDEV=y +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +CONFIG_USB=m +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_MON=m +CONFIG_USB_XHCI_HCD=m +CONFIG_USB_EHCI_HCD=m +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_ACM=m +CONFIG_USB_STORAGE=m +CONFIG_USB_MUSB_HDRC=m +CONFIG_USB_MUSB_TUSB6010=m +CONFIG_USB_MUSB_OMAP2PLUS=m +CONFIG_USB_MUSB_AM35X=m +CONFIG_USB_MUSB_DSPS=m +CONFIG_USB_INVENTRA_DMA=y +CONFIG_USB_TI_CPPI41_DMA=y +CONFIG_USB_TUSB_OMAP_DMA=y +CONFIG_USB_DWC3=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_SIMPLE=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_PL2303=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_TEST=m +CONFIG_NOP_USB_XCEIV=m +CONFIG_AM335X_PHY_USB=m +CONFIG_TWL6030_USB=m +CONFIG_USB_GADGET=m +CONFIG_USB_GADGET_DEBUG=y +CONFIG_USB_GADGET_DEBUG_FILES=y +CONFIG_USB_GADGET_DEBUG_FS=y +CONFIG_USB_CONFIGFS=m +CONFIG_USB_CONFIGFS_SERIAL=y +CONFIG_USB_CONFIGFS_ACM=y +CONFIG_USB_CONFIGFS_OBEX=y +CONFIG_USB_CONFIGFS_NCM=y +CONFIG_USB_CONFIGFS_ECM=y +CONFIG_USB_CONFIGFS_ECM_SUBSET=y +CONFIG_USB_CONFIGFS_RNDIS=y +CONFIG_USB_CONFIGFS_EEM=y +CONFIG_USB_CONFIGFS_PHONET=y +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +CONFIG_USB_CONFIGFS_F_LB_SS=y +CONFIG_USB_CONFIGFS_F_FS=y +CONFIG_USB_CONFIGFS_F_UAC1=y +CONFIG_USB_CONFIGFS_F_UAC2=y +CONFIG_USB_CONFIGFS_F_MIDI=y +CONFIG_USB_CONFIGFS_F_HID=y +CONFIG_USB_ZERO=m +CONFIG_USB_G_NOKIA=m +CONFIG_MMC=y +CONFIG_SDIO_UART=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_OMAP=y +CONFIG_MMC_OMAP_HS=y +CONFIG_MMC_SDHCI_OMAP=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=m +CONFIG_LEDS_CPCAP=m +CONFIG_LEDS_LM3532=m +CONFIG_LEDS_GPIO=m +CONFIG_LEDS_PCA963X=m +CONFIG_LEDS_PWM=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_LEDS_TRIGGER_ONESHOT=m +CONFIG_LEDS_TRIGGER_HEARTBEAT=m +CONFIG_LEDS_TRIGGER_BACKLIGHT=m +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_GPIO=m +CONFIG_LEDS_TRIGGER_DEFAULT_ON=m +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_TWL92330=y +CONFIG_RTC_DRV_TWL4030=m +CONFIG_RTC_DRV_PALMAS=m +CONFIG_RTC_DRV_OMAP=m +CONFIG_RTC_DRV_CPCAP=m +CONFIG_DMADEVICES=y +CONFIG_OMAP_IOMMU=y +CONFIG_REMOTEPROC=y +CONFIG_OMAP_REMOTEPROC=m +CONFIG_WKUP_M3_RPROC=m +CONFIG_SOC_TI=y +CONFIG_AMX3_PM=m +CONFIG_WKUP_M3_IPC=m +CONFIG_EXTCON_PALMAS=m +CONFIG_EXTCON_USB_GPIO=m +CONFIG_TI_EMIF=m +CONFIG_TI_EMIF_SRAM=m +CONFIG_IIO=m +CONFIG_IIO_SW_DEVICE=m +CONFIG_IIO_SW_TRIGGER=m +CONFIG_IIO_ST_ACCEL_3AXIS=m +CONFIG_CPCAP_ADC=m +CONFIG_TI_AM335X_ADC=m +CONFIG_BMP280=m +CONFIG_PWM=y +CONFIG_PWM_OMAP_DMTIMER=m +CONFIG_PWM_TIECAP=m +CONFIG_PWM_TIEHRPWM=y +CONFIG_PWM_TWL=m +CONFIG_PWM_TWL_LED=m +CONFIG_PHY_CPCAP_USB=m +CONFIG_PHY_MAPPHONE_MDM6600=m +CONFIG_PHY_DM816X_USB=m +CONFIG_OMAP_USB2=m +CONFIG_TI_PIPE3=y +CONFIG_TWL4030_USB=m +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +CONFIG_FANOTIFY=y +CONFIG_QUOTA=y +CONFIG_QFMT_V2=y +CONFIG_AUTOFS4_FS=m +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_SUMMARY=y +CONFIG_JFFS2_FS_XATTR=y +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RUBIN=y +CONFIG_UBIFS_FS=y +CONFIG_CRAMFS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_SECURITY=y +CONFIG_CRYPTO_MICHAEL_MIC=y +CONFIG_CRC_CCITT=y +CONFIG_CRC_T10DIF=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC7=y +CONFIG_LIBCRC32C=y +CONFIG_DMA_CMA=y +CONFIG_FONTS=y +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_PRINTK_TIME=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_SPLIT=y +CONFIG_DEBUG_INFO_DWARF4=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_SCHEDSTATS=y +# CONFIG_DEBUG_BUGVERBOSE is not set diff --git a/board/capu/beagleboneblack/patches/uboot/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch b/board/capu/beagleboneblack/patches/uboot/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch new file mode 100644 index 0000000..a71338a --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch @@ -0,0 +1,1192 @@ +From 7df92ced9b5cde7740d848a9163a1d0725b2d54f Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 21 Oct 2021 16:04:55 -0500 +Subject: [PATCH 1/9] am335x_evm-uEnv.txt-bootz-n-fixes + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + .../include/asm/arch-am33xx/hardware_am33xx.h | 1 + + arch/arm/include/asm/arch-am33xx/sys_proto.h | 1 + + arch/arm/mach-omap2/am33xx/board.c | 22 +- + arch/arm/mach-omap2/hwinit-common.c | 10 + + board/ti/am335x/board.c | 107 +++++++- + board/ti/am335x/board.h | 34 ++- + board/ti/am335x/mux.c | 7 +- + configs/am335x_evm_defconfig | 31 ++- + include/configs/am335x_evm.h | 94 ++++++- + include/configs/ti_armv7_common.h | 237 +++++++++++++++++ + include/environment/ti/boot.h | 243 ++++++++++++++++++ + include/environment/ti/mmc.h | 57 +++- + 12 files changed, 792 insertions(+), 52 deletions(-) + create mode 100644 include/environment/ti/boot.h + +diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h +index 878ef3e5..b42c7e67 100644 +--- a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h ++++ b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h +@@ -60,6 +60,7 @@ + + /* RTC base address */ + #define RTC_BASE 0x44E3E000 ++#define RTC_OSC (RTC_BASE + 0x0054) + + /* OTG */ + #define USB0_OTG_BASE 0x47401000 +diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h +index be17aad2..ebbf4439 100644 +--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h ++++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h +@@ -46,4 +46,5 @@ int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency); + void enable_usb_clocks(int index); + void disable_usb_clocks(int index); + void do_board_detect(void); ++void rtc32k_enable(void); + u32 get_sys_clk_index(void); +diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c +index d390f2e1..7bcd453c 100644 +--- a/arch/arm/mach-omap2/am33xx/board.c ++++ b/arch/arm/mach-omap2/am33xx/board.c +@@ -417,17 +417,17 @@ __weak void am33xx_spl_board_init(void) + { + } + +-#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC) +-static void rtc32k_enable(void) +-{ +- struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; +- +- rtc32k_unlock(rtc); +- +- /* Enable the RTC 32K OSC by setting bits 3 and 6. */ +- writel((1 << 3) | (1 << 6), &rtc->osc); +-} +-#endif ++//#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC) ++//static void rtc32k_enable(void) ++//{ ++// struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; ++// ++// rtc32k_unlock(rtc); ++// ++// /* Enable the RTC 32K OSC by setting bits 3 and 6. */ ++// writel((1 << 3) | (1 << 6), &rtc->osc); ++//} ++//#endif + + static void uart_soft_reset(void) + { +diff --git a/arch/arm/mach-omap2/hwinit-common.c b/arch/arm/mach-omap2/hwinit-common.c +index 3da50f97..bcc6be84 100644 +--- a/arch/arm/mach-omap2/hwinit-common.c ++++ b/arch/arm/mach-omap2/hwinit-common.c +@@ -134,6 +134,16 @@ void __weak do_board_detect(void) + { + } + ++/** ++ * rtc32k_enable() - Detect board description ++ * ++ * Function to detect board description. This is expected to be ++ * overridden in the SoC family board file where desired. ++ */ ++void __weak rtc32k_enable(void) ++{ ++} ++ + /** + * vcores_init() - Assign omap_vcores based on board + * +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index 2e4f3d10..af0c386e 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -34,6 +34,7 @@ + #include <asm/omap_common.h> + #include <asm/omap_sec_common.h> + #include <asm/omap_mmc.h> ++#include <asm/davinci_rtc.h> + #include <i2c.h> + #include <miiphy.h> + #include <cpsw.h> +@@ -94,6 +95,8 @@ struct serial_device *default_serial_console(void) + { + if (board_is_icev2()) + return &eserial4_device; ++ else if (board_is_beaglelogic()) ++ return &eserial5_device; + else + return &eserial1_device; + } +@@ -276,7 +279,7 @@ const struct dpll_params *get_dpll_ddr_params(void) + + if (board_is_evm_sk()) + return &dpll_ddr3_303MHz[ind]; +- else if (board_is_pb() || board_is_bone_lt() || board_is_icev2()) ++ else if (board_is_pb() || board_is_bone_lt() || board_is_icev2() || board_is_beaglelogic()) + return &dpll_ddr3_400MHz[ind]; + else if (board_is_evm_15_or_later()) + return &dpll_ddr3_303MHz[ind]; +@@ -307,7 +310,7 @@ const struct dpll_params *get_dpll_mpu_params(void) + if (bone_not_connected_to_ac_power()) + freq = MPUPLL_M_600; + +- if (board_is_pb() || board_is_bone_lt()) ++ if (board_is_pb() || board_is_bone_lt() || board_is_beaglelogic()) + freq = MPUPLL_M_1000; + + switch (freq) { +@@ -359,7 +362,7 @@ static void scale_vcores_bone(int freq) + * Override what we have detected since we know if we have + * a Beaglebone Black it supports 1GHz. + */ +- if (board_is_pb() || board_is_bone_lt()) ++ if (board_is_pb() || board_is_bone_lt() || board_is_beaglelogic()) + freq = MPUPLL_M_1000; + + switch (freq) { +@@ -496,7 +499,11 @@ void scale_vcores(void) + void set_uart_mux_conf(void) + { + #if CONFIG_CONS_INDEX == 1 +- enable_uart0_pin_mux(); ++ if (board_is_beaglelogic()) ++ enable_uart4_pin_mux(); ++ else ++ enable_uart0_pin_mux(); ++ + #elif CONFIG_CONS_INDEX == 2 + enable_uart1_pin_mux(); + #elif CONFIG_CONS_INDEX == 3 +@@ -566,7 +573,7 @@ void sdram_init(void) + if (board_is_evm_sk()) + config_ddr(303, &ioregs_evmsk, &ddr3_data, + &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0); +- else if (board_is_pb() || board_is_bone_lt()) ++ else if (board_is_pb() || board_is_bone_lt() || board_is_beaglelogic()) + config_ddr(400, &ioregs_bonelt, + &ddr3_beagleblack_data, + &ddr3_beagleblack_cmd_ctrl_data, +@@ -709,11 +716,60 @@ done: + } + #endif + ++#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC) ++void rtc32k_enable(void) ++{ ++ struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; ++ ++ /* ++ * Unlock the RTC's registers. For more details please see the ++ * RTC_SS section of the TRM. In order to unlock we need to ++ * write these specific values (keys) in this order. ++ */ ++ writel(RTC_KICK0R_WE, &rtc->kick0r); ++ writel(RTC_KICK1R_WE, &rtc->kick1r); ++ ++ if (board_is_pb() || board_is_blue()) { ++ /* 6: EN_32KCLK */ ++ /* 3: SEL_32KCLK_SRC 0: internal, 1: external */ ++ writel((0 << 3) | (1 << 6), &rtc->osc); ++ } else { ++ /* Enable the RTC 32K OSC by setting bits 3 and 6. */ ++ writel((1 << 3) | (1 << 6), &rtc->osc); ++ } ++} ++#endif ++ + /* + * Basic board specific setup. Pinmux has been handled already. + */ + int board_init(void) + { ++ u32 sys_reboot, sys_rtc_osc; ++ ++ sys_reboot = readl(PRM_RSTST); ++ if (sys_reboot & (1 << 9)) ++ puts("Reset Source: IcePick reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 5)) ++ puts("Reset Source: Global external warm reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 4)) ++ puts("Reset Source: watchdog reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 1)) ++ puts("Reset Source: Global warm SW reset has occurred.\n"); ++ ++ if (sys_reboot & (1 << 0)) ++ puts("Reset Source: Power-on reset has occurred.\n"); ++ ++ sys_rtc_osc = readl(RTC_OSC); ++ if (sys_rtc_osc & (1 << 3)) { ++ puts("RTC 32KCLK Source: External.\n"); ++ } else { ++ puts("RTC 32KCLK Source: Internal.\n"); ++ } ++ + #if defined(CONFIG_HW_WATCHDOG) + hw_watchdog_init(); + #endif +@@ -811,6 +867,8 @@ int board_late_init(void) + char *name = NULL; + + if (board_is_bone_lt()) { ++ puts("Board: BeagleBone Black\n"); ++ name = "A335BNLT"; + /* BeagleBoard.org BeagleBone Black Wireless: */ + if (!strncmp(board_ti_get_rev(), "BWA", 3)) { + name = "BBBW"; +@@ -819,16 +877,49 @@ int board_late_init(void) + if (!strncmp(board_ti_get_rev(), "GW1", 3)) { + name = "BBGW"; + } ++ /* SeeedStudio BeagleBone Green Gateway */ ++ if (!strncmp(board_ti_get_rev(), "GG1", 3)) { ++ name = "BBGG"; ++ } + /* BeagleBoard.org BeagleBone Blue */ + if (!strncmp(board_ti_get_rev(), "BLA", 3)) { + name = "BBBL"; + } ++ /* Octavo Systems OSD3358-SM-RED */ ++ if (!strncmp(board_ti_get_rev(), "OS00", 4)) { ++ puts("Model: Octavo Systems OSD3358-SM-RED\n"); ++ name = "OS00"; ++ } ++ /* Octavo Systems OSD3358-SM-RED 01*/ ++ if (!strncmp(board_ti_get_rev(), "OS01", 4)) { ++ puts("Model: Octavo Systems OSD3358-SM-RED 01\n"); ++ name = "OS01"; ++ } + } + +- if (board_is_bbg1()) ++ if (board_is_bbg1()) { + name = "BBG1"; +- if (board_is_bben()) +- name = "BBEN"; ++ } ++ ++ if (board_is_bben()) { ++ char subtype_id = board_ti_get_config()[1]; ++ if (subtype_id == 'L') { ++ puts("Model: Sancloud BeagleBone Enhanced Lite (BBE Lite)\n"); ++ name = "BBELITE"; ++ } else { ++ puts("Model: SanCloud BeagleBone Enhanced\n"); ++ name = "BBEN"; ++ } ++ } ++ ++ if (board_is_pb()) { ++ puts("Model: BeagleBoard.org PocketBeagle\n"); ++ } ++ ++ if (board_is_beaglelogic()) { ++ puts("Model: BeagleLogic\n"); ++ } ++ + set_board_info_env(name); + + /* +diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h +index c2962111..1c6761f3 100644 +--- a/board/ti/am335x/board.h ++++ b/board/ti/am335x/board.h +@@ -23,6 +23,11 @@ + #define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414 + #define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3d + ++static inline int board_is_beaglelogic(void) ++{ ++ return board_ti_is("A335BLGC"); ++} ++ + static inline int board_is_bone(void) + { + return board_ti_is("A335BONE"); +@@ -38,20 +43,47 @@ static inline int board_is_pb(void) + return board_ti_is("A335PBGL"); + } + ++static inline int board_is_bbbw(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BW", 2); ++} ++ ++static inline int board_is_blue(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BLA", 3); ++} ++ + static inline int board_is_bbg1(void) + { + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4); + } + ++static inline int board_is_bbgg1(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "GG1", 3); ++} ++ + static inline int board_is_bben(void) + { + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "SE", 2); + } + ++static inline int board_is_bbbi(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "EIA0", 4); ++} ++ ++static inline int board_is_os00(void) ++{ ++ return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "OS00", 4); ++} ++ + static inline int board_is_beaglebonex(void) + { + return board_is_pb() || board_is_bone() || board_is_bone_lt() || +- board_is_bbg1() || board_is_bben(); ++ board_is_bbg1() || board_is_bbgg1() || board_is_bben() || ++ board_is_bbbi() || board_is_beaglelogic() || ++ board_is_os00(); + } + + static inline int board_is_evm_sk(void) +diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c +index e450ff64..b498e78d 100644 +--- a/board/ti/am335x/mux.c ++++ b/board/ti/am335x/mux.c +@@ -65,7 +65,6 @@ static struct module_pin_mux mmc0_pin_mux[] = { + {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */ + {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */ + {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */ +- {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */ + {OFFSET(spi0_cs1), (MODE(7) | RXACTIVE | PULLUP_EN)}, /* GPIO0_6 */ + {-1}, + }; +@@ -369,7 +368,11 @@ static unsigned short detect_daughter_board_profile(void) + void enable_board_pin_mux(void) + { + /* Do board-specific muxes. */ +- if (board_is_bone()) { ++ if (board_is_beaglelogic()) { ++ /* BeagleLogic pinmux */ ++ configure_module_pin_mux(mii1_pin_mux); ++ configure_module_pin_mux(mmc0_pin_mux); ++ } else if (board_is_bone()) { + /* Beaglebone pinmux */ + configure_module_pin_mux(mii1_pin_mux); + configure_module_pin_mux(mmc0_pin_mux); +diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig +index ef8de599..0bc28ab3 100644 +--- a/configs/am335x_evm_defconfig ++++ b/configs/am335x_evm_defconfig +@@ -2,14 +2,19 @@ CONFIG_ARM=y + CONFIG_ARCH_CPU_INIT=y + CONFIG_ARCH_OMAP2PLUS=y + CONFIG_TI_COMMON_CMD_OPTIONS=y +-CONFIG_DEFAULT_DEVICE_TREE="am335x-evm" ++CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack" + CONFIG_AM33XX=y + CONFIG_SPL=y + CONFIG_DISTRO_DEFAULTS=y + CONFIG_SPL_LOAD_FIT=y + # CONFIG_USE_SPL_FIT_GENERATOR is not set + CONFIG_OF_BOARD_SETUP=y +-CONFIG_BOOTCOMMAND="run findfdt; run init_console; run finduuid; run distro_bootcmd" ++CONFIG_BOOTDELAY=0 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" ++CONFIG_AUTOBOOT_DELAY_STR="d" ++CONFIG_AUTOBOOT_STOP_STR=" " ++CONFIG_BOOTCOMMAND="run findfdt; run init_console; run envboot; run distro_bootcmd" + CONFIG_LOGLEVEL=3 + CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_ARCH_MISC_INIT=y +@@ -18,27 +23,32 @@ CONFIG_SPL_ETH=y + # CONFIG_SPL_FS_EXT4 is not set + CONFIG_SPL_MTD_SUPPORT=y + CONFIG_SPL_MUSB_NEW=y +-CONFIG_SPL_NAND_DRIVERS=y +-CONFIG_SPL_NAND_ECC=y +-CONFIG_SPL_NAND_BASE=y ++# CONFIG_SPL_NAND_SUPPORT is not set + CONFIG_SPL_NET_SUPPORT=y + CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL" + CONFIG_SPL_OS_BOOT=y + CONFIG_SPL_USB_GADGET=y + CONFIG_SPL_USB_ETHER=y ++CONFIG_CMD_EXTENSION=y + CONFIG_CMD_SPL=y +-CONFIG_CMD_SPL_NAND_OFS=0x00080000 + # CONFIG_CMD_FLASH is not set +-CONFIG_CMD_NAND=y ++CONFIG_CMD_GPT_RENAME=y ++CONFIG_CMD_LSBLK=y ++CONFIG_CMD_MMC_SWRITE=y ++CONFIG_CMD_CLONE=y ++CONFIG_CMD_USB_MASS_STORAGE=y + # CONFIG_CMD_SETEXPR is not set + CONFIG_BOOTP_DNS2=y ++CONFIG_CMD_BTRFS=y + CONFIG_CMD_MTDPARTS=y +-CONFIG_MTDIDS_DEFAULT="nand0=nand.0" +-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)" + # CONFIG_SPL_EFI_PARTITION is not set + CONFIG_OF_CONTROL=y +-CONFIG_OF_LIST="am335x-evm am335x-bone am335x-sancloud-bbe am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle" + CONFIG_ENV_OVERWRITE=y ++# CONFIG_ENV_IS_IN_FAT is not set ++CONFIG_ENV_IS_IN_EXT4=y ++CONFIG_ENV_EXT4_INTERFACE="mmc" ++CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1" ++CONFIG_ENV_EXT4_FILE="/boot/uboot.env" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y + CONFIG_SPL_ENV_IS_NOWHERE=y +@@ -90,4 +100,3 @@ CONFIG_WDT=y + # CONFIG_SPL_WDT is not set + CONFIG_DYNAMIC_CRC_TABLE=y + CONFIG_RSA=y +-CONFIG_LZO=y +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index ad5616d2..b5e5f2dc 100644 +--- a/include/configs/am335x_evm.h ++++ b/include/configs/am335x_evm.h +@@ -50,6 +50,16 @@ + #define NANDARGS "" + #endif + ++#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ ++ "bootcmd_" #devtypel #instance "=" \ ++ "setenv devtype mmc; " \ ++ "setenv mmcdev " #instance"; "\ ++ "setenv bootpart " #instance":1 ; "\ ++ "run boot\0" ++ ++#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ ++ #devtypel #instance " " ++ + #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel "=" \ + "run nandboot\0" +@@ -77,22 +87,26 @@ + + #define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ ++ func(LEGACY_MMC, legacy_mmc, 0) \ + func(MMC, mmc, 1) \ +- func(NAND, nand, 0) \ +- BOOT_TARGET_USB(func) \ +- BOOT_TARGET_PXE(func) \ +- BOOT_TARGET_DHCP(func) ++ func(LEGACY_MMC, legacy_mmc, 1) \ ++ BOOT_TARGET_USB(func) + + #include <config_distro_bootcmd.h> + + #ifndef CONFIG_SPL_BUILD + #include <environment/ti/dfu.h> ++#include <environment/ti/mmc.h> + + #define CONFIG_EXTRA_ENV_SETTINGS \ + DEFAULT_LINUX_BOOT_ENV \ ++ DEFAULT_MMC_TI_ARGS \ ++ "bootpart=0:2\0" \ ++ "bootdir=/boot\0" \ ++ "bootfile=zImage\0" \ ++ "board_eeprom_header=undefined\0" \ + "fdtfile=undefined\0" \ +- "finduuid=part uuid mmc 0:2 uuid\0" \ +- "console=ttyO0,115200n8\0" \ ++ "console=ttyS0,115200n8\0" \ + "partitions=" \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=bootloader,start=384K,size=1792K," \ +@@ -120,14 +134,58 @@ + "sf probe ${spibusno}:0; " \ + "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \ + "bootz ${loadaddr}\0" \ ++ "pb_eeprom_hdr=" \ ++ "mw 82001000 ee3355aa; " \ ++ "mw 82001004 35333341; " \ ++ "mw 82001008 4c474250\0" \ ++ "eeprom_program="\ ++ "if test $board_eeprom_header = bbb_blank; then " \ ++ "run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_dump; reset; fi; " \ ++ "if test $board_eeprom_header = bbbl_blank; then " \ ++ "run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_bbbl_footer; run eeprom_dump; reset; fi; " \ ++ "if test $board_eeprom_header = bbbw_blank; then " \ ++ "run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_bbbw_footer; run eeprom_dump; reset; fi; " \ ++ "if test $board_eeprom_header = pocketbeagle_blank; then " \ ++ "run eeprom_dump; run eeprom_blank; run eeprom_pocketbeagle; run eeprom_dump; reset; fi; " \ ++ "if test $board_eeprom_header = bbgg_blank; then " \ ++ "run eeprom_dump; run eeprom_blank; run eeprom_bbb_header; run eeprom_bbgg_footer; run eeprom_dump; reset; fi; " \ ++ "if test $board_eeprom_header = beaglelogic_blank; then " \ ++ "run eeprom_dump; run eeprom_blank; run eeprom_beaglelogic; run eeprom_dump; reset; fi; \0" \ + "ramboot=echo Booting from ramdisk ...; " \ + "run ramargs; " \ + "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ + "findfdt="\ ++ "echo board_name=[$board_name] ...; " \ ++ "if test $board_name = A335BLGC; then " \ ++ "setenv fdtfile am335x-beaglelogic.dtb; fi; " \ + "if test $board_name = A335BONE; then " \ + "setenv fdtfile am335x-bone.dtb; fi; " \ + "if test $board_name = A335BNLT; then " \ +- "setenv fdtfile am335x-boneblack.dtb; fi; " \ ++ "echo board_rev=[$board_rev] ...; " \ ++ "if test $board_rev = GH01; then " \ ++ "setenv fdtfile am335x-boneblack.dtb; " \ ++ "elif test $board_rev = BBG1; then " \ ++ "setenv fdtfile am335x-bonegreen.dtb; " \ ++ "elif test $board_rev = BP00; then " \ ++ "setenv fdtfile am335x-pocketbone.dtb; " \ ++ "elif test $board_rev = GW1A; then " \ ++ "setenv fdtfile am335x-bonegreen-wireless.dtb; " \ ++ "elif test $board_rev = GG1A; then " \ ++ "setenv fdtfile am335x-bonegreen-gateway.dtb; " \ ++ "elif test $board_rev = AIA0; then " \ ++ "setenv fdtfile am335x-abbbi.dtb; " \ ++ "elif test $board_rev = EIA0; then " \ ++ "setenv fdtfile am335x-boneblack.dtb; " \ ++ "elif test $board_rev = ME06; then " \ ++ "setenv fdtfile am335x-bonegreen.dtb; " \ ++ "elif test $board_rev = OS00; then " \ ++ "setenv fdtfile am335x-osd3358-sm-red.dtb; " \ ++ "elif test $board_rev = OS01; then " \ ++ "setenv fdtfile am335x-osd3358-sm-red-01.dtb; " \ ++ "else " \ ++ "setenv fdtfile am335x-boneblack.dtb; " \ ++ "fi; " \ ++ "fi; " \ + "if test $board_name = A335PBGL; then " \ + "setenv fdtfile am335x-pocketbeagle.dtb; fi; " \ + "if test $board_name = BBBW; then " \ +@@ -136,10 +194,18 @@ + "setenv fdtfile am335x-bonegreen.dtb; fi; " \ + "if test $board_name = BBGW; then " \ + "setenv fdtfile am335x-bonegreen-wireless.dtb; fi; " \ ++ "if test $board_name = BBGG; then " \ ++ "setenv fdtfile am335x-bonegreen-gateway.dtb; fi; " \ + "if test $board_name = BBBL; then " \ + "setenv fdtfile am335x-boneblue.dtb; fi; " \ + "if test $board_name = BBEN; then " \ + "setenv fdtfile am335x-sancloud-bbe.dtb; fi; " \ ++ "if test $board_name = BBELITE; then " \ ++ "setenv fdtfile am335x-sancloud-bbe-lite.dtb; fi; " \ ++ "if test $board_name = OS00; then " \ ++ "setenv fdtfile am335x-osd3358-sm-red.dtb; fi; " \ ++ "if test $board_name = OS01; then " \ ++ "setenv fdtfile am335x-osd3358-sm-red-01.dtb; fi; " \ + "if test $board_name = A33515BB; then " \ + "setenv fdtfile am335x-evm.dtb; fi; " \ + "if test $board_name = A335X_SK; then " \ +@@ -147,13 +213,21 @@ + "if test $board_name = A335_ICE; then " \ + "setenv fdtfile am335x-icev2.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ +- "echo WARNING: Could not determine device tree to use; fi; \0" \ ++ "setenv board_name A335BNLT; " \ ++ "setenv board_rev EMMC; " \ ++ "setenv fdtfile am335x-bonegreen.dtb; " \ ++ "fi; \0" \ + "init_console=" \ + "if test $board_name = A335_ICE; then "\ +- "setenv console ttyO3,115200n8;" \ ++ "setenv console ttyS3,115200n8;" \ ++ "elif test $board_name = A335BLGC; then " \ ++ "setenv console ttyS4,115200n8;" \ + "else " \ +- "setenv console ttyO0,115200n8;" \ ++ "setenv console ttyS0,115200n8;" \ + "fi;\0" \ ++ EEWIKI_BOOT \ ++ EEWIKI_UNAME_BOOT \ ++ EEPROM_PROGRAMMING \ + NANDARGS \ + NETARGS \ + DFUARGS \ +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index 4fcf741c..78c3d195 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -112,6 +112,243 @@ + /* Boot Argument Buffer Size */ + #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + ++#define EEPROM_PROGRAMMING \ ++ "eeprom_dump=i2c dev 0; " \ ++ "i2c md 0x50 0x00.2 20; " \ ++ "\0" \ ++ "eeprom_blank=i2c dev 0; " \ ++ "i2c mw 0x50 0x00.2 ff; " \ ++ "i2c mw 0x50 0x01.2 ff; " \ ++ "i2c mw 0x50 0x02.2 ff; " \ ++ "i2c mw 0x50 0x03.2 ff; " \ ++ "i2c mw 0x50 0x04.2 ff; " \ ++ "i2c mw 0x50 0x05.2 ff; " \ ++ "i2c mw 0x50 0x06.2 ff; " \ ++ "i2c mw 0x50 0x07.2 ff; " \ ++ "i2c mw 0x50 0x08.2 ff; " \ ++ "i2c mw 0x50 0x09.2 ff; " \ ++ "i2c mw 0x50 0x0a.2 ff; " \ ++ "i2c mw 0x50 0x0b.2 ff; " \ ++ "i2c mw 0x50 0x0c.2 ff; " \ ++ "i2c mw 0x50 0x0d.2 ff; " \ ++ "i2c mw 0x50 0x0e.2 ff; " \ ++ "i2c mw 0x50 0x0f.2 ff; " \ ++ "i2c mw 0x50 0x10.2 ff; " \ ++ "i2c mw 0x50 0x11.2 ff; " \ ++ "i2c mw 0x50 0x12.2 ff; " \ ++ "i2c mw 0x50 0x13.2 ff; " \ ++ "i2c mw 0x50 0x14.2 ff; " \ ++ "i2c mw 0x50 0x15.2 ff; " \ ++ "i2c mw 0x50 0x16.2 ff; " \ ++ "i2c mw 0x50 0x17.2 ff; " \ ++ "i2c mw 0x50 0x18.2 ff; " \ ++ "i2c mw 0x50 0x19.2 ff; " \ ++ "i2c mw 0x50 0x1a.2 ff; " \ ++ "i2c mw 0x50 0x1b.2 ff; " \ ++ "i2c mw 0x50 0x1c.2 ff; " \ ++ "i2c mw 0x50 0x1d.2 ff; " \ ++ "i2c mw 0x50 0x1e.2 ff; " \ ++ "i2c mw 0x50 0x1f.2 ff; " \ ++ "\0" \ ++ "eeprom_bbb_header=i2c dev 0; " \ ++ "i2c mw 0x50 0x00.2 aa; " \ ++ "i2c mw 0x50 0x01.2 55; " \ ++ "i2c mw 0x50 0x02.2 33; " \ ++ "i2c mw 0x50 0x03.2 ee; " \ ++ "i2c mw 0x50 0x04.2 41; " \ ++ "i2c mw 0x50 0x05.2 33; " \ ++ "i2c mw 0x50 0x06.2 33; " \ ++ "i2c mw 0x50 0x07.2 35; " \ ++ "i2c mw 0x50 0x08.2 42; " \ ++ "i2c mw 0x50 0x09.2 4e; " \ ++ "i2c mw 0x50 0x0a.2 4c; " \ ++ "i2c mw 0x50 0x0b.2 54; " \ ++ "\0" \ ++ "eeprom_bbbl_footer= " \ ++ "i2c mw 0x50 0x0c.2 42; " \ ++ "i2c mw 0x50 0x0d.2 4c; " \ ++ "i2c mw 0x50 0x0e.2 41; " \ ++ "i2c mw 0x50 0x0f.2 32; " \ ++ "\0" \ ++ "eeprom_bbbw_footer= " \ ++ "i2c mw 0x50 0x0c.2 42; " \ ++ "i2c mw 0x50 0x0d.2 57; " \ ++ "i2c mw 0x50 0x0e.2 41; " \ ++ "i2c mw 0x50 0x0f.2 35; " \ ++ "\0" \ ++ "eeprom_bbgg_footer= " \ ++ "i2c mw 0x50 0x0c.2 47; " \ ++ "i2c mw 0x50 0x0d.2 47; " \ ++ "i2c mw 0x50 0x0e.2 31; " \ ++ "i2c mw 0x50 0x0f.2 41; " \ ++ "\0" \ ++ "eeprom_pocketbeagle= " \ ++ "i2c mw 0x50 0x00.2 aa; " \ ++ "i2c mw 0x50 0x01.2 55; " \ ++ "i2c mw 0x50 0x02.2 33; " \ ++ "i2c mw 0x50 0x03.2 ee; " \ ++ "i2c mw 0x50 0x04.2 41; " \ ++ "i2c mw 0x50 0x05.2 33; " \ ++ "i2c mw 0x50 0x06.2 33; " \ ++ "i2c mw 0x50 0x07.2 35; " \ ++ "i2c mw 0x50 0x08.2 50; " \ ++ "i2c mw 0x50 0x09.2 42; " \ ++ "i2c mw 0x50 0x0a.2 47; " \ ++ "i2c mw 0x50 0x0b.2 4c; " \ ++ "i2c mw 0x50 0x0c.2 30; " \ ++ "i2c mw 0x50 0x0d.2 30; " \ ++ "i2c mw 0x50 0x0e.2 41; " \ ++ "i2c mw 0x50 0x0f.2 32; " \ ++ "\0" \ ++ "eeprom_beaglelogic= " \ ++ "i2c mw 0x50 0x00.2 aa; " \ ++ "i2c mw 0x50 0x01.2 55; " \ ++ "i2c mw 0x50 0x02.2 33; " \ ++ "i2c mw 0x50 0x03.2 ee; " \ ++ "i2c mw 0x50 0x04.2 41; " \ ++ "i2c mw 0x50 0x05.2 33; " \ ++ "i2c mw 0x50 0x06.2 33; " \ ++ "i2c mw 0x50 0x07.2 35; " \ ++ "i2c mw 0x50 0x08.2 42; " \ ++ "i2c mw 0x50 0x09.2 4c; " \ ++ "i2c mw 0x50 0x0a.2 47; " \ ++ "i2c mw 0x50 0x0b.2 43; " \ ++ "i2c mw 0x50 0x0c.2 30; " \ ++ "i2c mw 0x50 0x0d.2 30; " \ ++ "i2c mw 0x50 0x0e.2 30; " \ ++ "i2c mw 0x50 0x0f.2 41; " \ ++ "\0" \ ++ ++#define EEWIKI_BOOT \ ++ "boot=${devtype} dev ${mmcdev}; " \ ++ "if ${devtype} rescan; then " \ ++ "setenv bootpart ${mmcdev}:1; " \ ++ "if test -e ${devtype} ${bootpart} /etc/fstab; then " \ ++ "setenv mmcpart 1;" \ ++ "fi; " \ ++ "echo Checking for: /uEnv.txt ...;" \ ++ "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \ ++ "if run loadbootenv; then " \ ++ "echo Loaded environment from /uEnv.txt;" \ ++ "run importbootenv;" \ ++ "fi;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi; " \ ++ "echo Checking for: /boot/uEnv.txt ...;" \ ++ "for i in 1 2 3 4 5 6 7 ; do " \ ++ "setenv mmcpart ${i};" \ ++ "setenv bootpart ${mmcdev}:${mmcpart};" \ ++ "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \ ++ "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "if test -n ${dtb}; then " \ ++ "echo debug: [dtb=${dtb}] ... ;" \ ++ "setenv fdtfile ${dtb};" \ ++ "echo Using: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ ++ "if test -n ${uname_r}; then " \ ++ "setenv oldroot /dev/mmcblk${mmcdev}p${mmcpart};" \ ++ "echo Running uname_boot ...;" \ ++ "run uname_boot;" \ ++ "fi;" \ ++ "fi;" \ ++ "done;" \ ++ "fi;\0" \ ++ ++#define EEWIKI_UNAME_BOOT \ ++ "uname_boot="\ ++ "setenv bootdir /boot; " \ ++ "setenv bootfile vmlinuz-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \ ++ "echo loading ${bootdir}/${bootfile} ...; "\ ++ "run loadimage;" \ ++ "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtbs; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot/dtb; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "setenv fdtdir /boot; " \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "if test -e ${devtype} ${bootpart} ${fdtfile}; then " \ ++ "run loadfdt;" \ ++ "else " \ ++ "echo; echo unable to find [dtb=${fdtfile}] did you name it correctly? ...; " \ ++ "run failumsboot;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi; " \ ++ "setenv rdfile initrd.img-${uname_r}; " \ ++ "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ ++ "echo loading ${bootdir}/${rdfile} ...; "\ ++ "run loadrd;" \ ++ "if test -n ${netinstall_enable}; then " \ ++ "run args_netinstall; run message;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "if test -n ${uuid}; then " \ ++ "run args_mmc_uuid;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "else " \ ++ "if test -n ${uenv_root}; then " \ ++ "run args_uenv_root;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "run args_mmc_old;" \ ++ "echo debug: [${bootargs}] ... ;" \ ++ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi;" \ ++ "fi;\0" \ ++ + /* + * When we have SPI, NOR or NAND flash we expect to be making use of + * mtdparts, both for ease of use in U-Boot and for passing information +diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h +new file mode 100644 +index 00000000..a9d8f28d +--- /dev/null ++++ b/include/environment/ti/boot.h +@@ -0,0 +1,243 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Boot related environment variable definitions on TI boards. ++ * ++ * (C) Copyright 2017 Linaro Ltd. ++ * Sam Protsenko <semen.protsenko@linaro.org> ++ */ ++ ++#ifndef __TI_BOOT_H ++#define __TI_BOOT_H ++ ++#include <linux/stringify.h> ++ ++#ifndef CONSOLEDEV ++#define CONSOLEDEV "ttyS2" ++#endif ++ ++#ifndef PARTS_DEFAULT ++/* ++ * Default GPT tables for eMMC (Linux and Android). Notes: ++ * 1. Keep partitions aligned to erase group size (512 KiB) when possible ++ * 2. Keep partitions in sync with DFU_ALT_INFO_EMMC (see dfu.h) ++ * 3. Keep 'bootloader' partition (U-Boot proper) start address in sync with ++ * CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (see common/spl/Kconfig) ++ */ ++#define PARTS_DEFAULT \ ++ /* Linux partitions */ \ ++ "uuid_disk=${uuid_gpt_disk};" \ ++ "name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};" \ ++ "name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}\0" \ ++ /* Android partitions */ \ ++ "partitions_android=" \ ++ "uuid_disk=${uuid_gpt_disk};" \ ++ "name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};" \ ++ "name=bootloader,size=2048K,uuid=${uuid_gpt_bootloader};" \ ++ "name=uboot-env,start=2432K,size=256K,uuid=${uuid_gpt_reserved};" \ ++ "name=misc,size=128K,uuid=${uuid_gpt_misc};" \ ++ "name=boot_a,size=20M,uuid=${uuid_gpt_boot_a};" \ ++ "name=boot_b,size=20M,uuid=${uuid_gpt_boot_b};" \ ++ "name=dtbo_a,size=8M,uuid=${uuid_gpt_dtbo_a};" \ ++ "name=dtbo_b,size=8M,uuid=${uuid_gpt_dtbo_b};" \ ++ "name=vbmeta_a,size=64K,uuid=${uuid_gpt_vbmeta_a};" \ ++ "name=vbmeta_b,size=64K,uuid=${uuid_gpt_vbmeta_b};" \ ++ "name=recovery,size=64M,uuid=${uuid_gpt_recovery};" \ ++ "name=super,size=2560M,uuid=${uuid_gpt_super};" \ ++ "name=metadata,size=16M,uuid=${uuid_gpt_metadata};" \ ++ "name=userdata,size=-,uuid=${uuid_gpt_userdata}" ++#endif /* PARTS_DEFAULT */ ++ ++#if defined(CONFIG_CMD_AVB) ++#define AVB_VERIFY_CHECK "if run avb_verify; then " \ ++ "echo AVB verification OK.;" \ ++ "set bootargs $bootargs $avb_bootargs;" \ ++ "else " \ ++ "echo AVB verification failed.;" \ ++ "exit; fi;" ++#define AVB_VERIFY_CMD "avb_verify=avb init 1; avb verify $slot_suffix;\0" ++#else ++#define AVB_VERIFY_CHECK "" ++#define AVB_VERIFY_CMD "" ++#endif ++ ++#define CONTROL_PARTITION "misc" ++ ++#if defined(CONFIG_CMD_AB_SELECT) ++#define AB_SELECT_SLOT \ ++ "if part number mmc 1 " CONTROL_PARTITION " control_part_number; " \ ++ "then " \ ++ "echo " CONTROL_PARTITION \ ++ " partition number:${control_part_number};" \ ++ "ab_select slot_name mmc ${mmcdev}:${control_part_number};" \ ++ "else " \ ++ "echo " CONTROL_PARTITION " partition not found;" \ ++ "exit;" \ ++ "fi;" \ ++ "setenv slot_suffix _${slot_name};" ++#define AB_SELECT_ARGS \ ++ "setenv bootargs_ab androidboot.slot_suffix=${slot_suffix}; " \ ++ "echo A/B cmdline addition: ${bootargs_ab};" \ ++ "setenv bootargs ${bootargs} ${bootargs_ab};" ++#else ++#define AB_SELECT_SLOT "" ++#define AB_SELECT_ARGS "" ++#endif ++ ++/* ++ * Prepares complete device tree blob for current board (for Android boot). ++ * ++ * Boot image or recovery image should be loaded into $loadaddr prior to running ++ * these commands. The logic of these commnads is next: ++ * ++ * 1. Read correct DTB for current SoC/board from boot image in $loadaddr ++ * to $fdtaddr ++ * 2. Merge all needed DTBO for current board from 'dtbo' partition into read ++ * DTB ++ * 3. User should provide $fdtaddr as 3rd argument to 'bootm' ++ */ ++#define PREPARE_FDT \ ++ "echo Preparing FDT...; " \ ++ "if test $board_name = am57xx_evm_reva3; then " \ ++ "echo \" Reading DTBO partition...\"; " \ ++ "part start mmc ${mmcdev} dtbo${slot_suffix} p_dtbo_start; " \ ++ "part size mmc ${mmcdev} dtbo${slot_suffix} p_dtbo_size; " \ ++ "mmc read ${dtboaddr} ${p_dtbo_start} ${p_dtbo_size}; " \ ++ "echo \" Reading DTB for AM57x EVM RevA3...\"; " \ ++ "abootimg get dtb --index=0 dtb_start dtb_size; " \ ++ "cp.b $dtb_start $fdtaddr $dtb_size; " \ ++ "fdt addr $fdtaddr 0x80000; " \ ++ "echo \" Applying DTBOs for AM57x EVM RevA3...\"; " \ ++ "adtimg addr $dtboaddr; " \ ++ "adtimg get dt --index=0 dtbo0_addr dtbo0_size; " \ ++ "fdt apply $dtbo0_addr; " \ ++ "adtimg get dt --index=1 dtbo1_addr dtbo1_size; " \ ++ "fdt apply $dtbo1_addr; " \ ++ "elif test $board_name = beagle_x15_revc; then " \ ++ "echo \" Reading DTB for Beagle X15 RevC...\"; " \ ++ "abootimg get dtb --index=0 dtb_start dtb_size; " \ ++ "cp.b $dtb_start $fdtaddr $dtb_size; " \ ++ "fdt addr $fdtaddr 0x80000; " \ ++ "else " \ ++ "echo Error: Android boot is not supported for $board_name; " \ ++ "exit; " \ ++ "fi; " \ ++ ++#define FASTBOOT_CMD \ ++ "echo Booting into fastboot ...; " \ ++ "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " ++ ++#define DEFAULT_COMMON_BOOT_TI_ARGS \ ++ "console=" CONSOLEDEV ",115200n8\0" \ ++ "fdtfile=undefined\0" \ ++ "bootpart=0:2\0" \ ++ "bootdir=/boot\0" \ ++ "bootfile=zImage\0" \ ++ "usbtty=cdc_acm\0" \ ++ "vram=16M\0" \ ++ AVB_VERIFY_CMD \ ++ "partitions=" PARTS_DEFAULT "\0" \ ++ "optargs=\0" \ ++ "dofastboot=0\0" \ ++ "emmc_linux_boot=" \ ++ "echo Trying to boot Linux from eMMC ...; " \ ++ "setenv mmcdev 1; " \ ++ "setenv bootpart 1:2; " \ ++ "setenv mmcroot /dev/mmcblk0p2 rw; " \ ++ "run mmcboot;\0" \ ++ "emmc_android_boot=" \ ++ "setenv mmcdev 1; " \ ++ "mmc dev $mmcdev; " \ ++ "mmc rescan; " \ ++ AB_SELECT_SLOT \ ++ "if bcb load " __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) " " \ ++ CONTROL_PARTITION "; then " \ ++ "setenv ardaddr -; " \ ++ "if bcb test command = bootonce-bootloader; then " \ ++ "echo Android: Bootloader boot...; " \ ++ "bcb clear command; bcb store; " \ ++ FASTBOOT_CMD \ ++ "exit; " \ ++ "elif bcb test command = boot-recovery; then " \ ++ "echo Android: Recovery boot...; " \ ++ "setenv ardaddr $loadaddr;" \ ++ "setenv apart recovery; " \ ++ "else " \ ++ "echo Android: Normal boot...; " \ ++ "setenv ardaddr $loadaddr; " \ ++ "setenv apart boot${slot_suffix}; " \ ++ "fi; " \ ++ "else " \ ++ "echo Warning: BCB is corrupted or does not exist; " \ ++ "echo Android: Normal boot...; " \ ++ "fi; " \ ++ "setenv eval_bootargs setenv bootargs $bootargs; " \ ++ "run eval_bootargs; " \ ++ "setenv machid fe6; " \ ++ AVB_VERIFY_CHECK \ ++ AB_SELECT_ARGS \ ++ "if part start mmc $mmcdev $apart boot_start; then " \ ++ "part size mmc $mmcdev $apart boot_size; " \ ++ "mmc read $loadaddr $boot_start $boot_size; " \ ++ PREPARE_FDT \ ++ "bootm $loadaddr $ardaddr $fdtaddr; " \ ++ "else " \ ++ "echo $apart partition not found; " \ ++ "exit; " \ ++ "fi;\0" ++ ++#ifdef CONFIG_OMAP54XX ++ ++#define DEFAULT_FDT_TI_ARGS \ ++ "findfdt="\ ++ "if test $board_name = omap5_uevm; then " \ ++ "setenv fdtfile omap5-uevm.dtb; fi; " \ ++ "if test $board_name = dra7xx; then " \ ++ "setenv fdtfile dra7-evm.dtb; fi;" \ ++ "if test $board_name = dra72x-revc; then " \ ++ "setenv fdtfile dra72-evm-revc.dtb; fi;" \ ++ "if test $board_name = dra72x; then " \ ++ "setenv fdtfile dra72-evm.dtb; fi;" \ ++ "if test $board_name = dra71x; then " \ ++ "setenv fdtfile dra71-evm.dtb; fi;" \ ++ "if test $board_name = dra76x_acd; then " \ ++ "setenv fdtfile dra76-evm.dtb; fi;" \ ++ "if test $board_name = beagle_x15; then " \ ++ "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ ++ "if test $board_name = beagle_x15_revb1; then " \ ++ "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \ ++ "if test $board_name = beagle_x15_revc; then " \ ++ "setenv fdtfile am57xx-beagle-x15-revc.dtb; fi;" \ ++ "if test $board_name = am5729_beagleboneai; then " \ ++ "setenv fdtfile am5729-beagleboneai.dtb; fi;" \ ++ "if test $board_name = am572x_idk; then " \ ++ "setenv fdtfile am572x-idk.dtb; fi;" \ ++ "if test $board_name = am574x_idk; then " \ ++ "setenv fdtfile am574x-idk.dtb; fi;" \ ++ "if test $board_name = am57xx_evm; then " \ ++ "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ ++ "if test $board_name = am57xx_evm_reva3; then " \ ++ "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ ++ "if test $board_name = am571x_idk; then " \ ++ "setenv fdtfile am571x-idk.dtb; fi;" \ ++ "if test $fdtfile = undefined; then " \ ++ "echo WARNING: Could not determine device tree to use; fi; \0" ++ ++#define CONFIG_BOOTCOMMAND \ ++ "if test ${dofastboot} -eq 1; then " \ ++ "echo Boot fastboot requested, resetting dofastboot ...;" \ ++ "setenv dofastboot 0; saveenv;" \ ++ FASTBOOT_CMD \ ++ "fi;" \ ++ "if test ${boot_fit} -eq 1; then " \ ++ "run update_to_fit;" \ ++ "fi;" \ ++ "run findfdt; " \ ++ "run envboot; " \ ++ "run mmcboot;" \ ++ "run emmc_linux_boot; " \ ++ "run emmc_android_boot; " \ ++ "" ++ ++#endif /* CONFIG_OMAP54XX */ ++ ++#endif /* __TI_BOOT_H */ +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index 769ea9d5..b671c048 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -11,20 +11,55 @@ + #define DEFAULT_MMC_TI_ARGS \ + "mmcdev=0\0" \ + "mmcrootfstype=ext4 rootwait\0" \ +- "finduuid=part uuid ${boot} ${bootpart} uuid\0" \ ++ "finduuid=part uuid ${devtype} ${bootpart} uuid\0" \ + "args_mmc=run finduuid;setenv bootargs console=${console} " \ ++ "${cape_uboot} " \ ++ "root=PARTUUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${uboot_detected_capes} " \ ++ "${cmdline}\0" \ ++ "args_mmc_old=setenv bootargs console=${console} " \ + "${optargs} " \ +- "root=PARTUUID=${uuid} rw " \ +- "rootfstype=${mmcrootfstype}\0" \ +- "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ +- "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ ++ "${cape_uboot} " \ ++ "root=${oldroot} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${uboot_detected_capes} " \ ++ "${cmdline}\0" \ ++ "args_mmc_uuid=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "${cape_uboot} " \ ++ "root=UUID=${uuid} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${uboot_detected_capes} " \ ++ "${cmdline}\0" \ ++ "args_uenv_root=setenv bootargs console=${console} " \ ++ "${optargs} " \ ++ "${cape_uboot} " \ ++ "root=${uenv_root} ro " \ ++ "rootfstype=${mmcrootfstype} " \ ++ "${uboot_detected_capes} " \ ++ "${cmdline}\0" \ ++ "args_netinstall=setenv bootargs ${netinstall_bootargs} " \ ++ "${optargs} " \ ++ "${cape_uboot} " \ ++ "root=/dev/ram rw " \ ++ "${uboot_detected_capes} " \ ++ "${cmdline}\0" \ ++ "script=boot.scr\0" \ ++ "scriptfile=${script}\0" \ ++ "loadbootscript=load ${devtype} ${bootpart} ${loadaddr} ${scriptfile};\0" \ ++ "bootscript=echo Running bootscript from mmc${bootpart} ...; " \ + "source ${loadaddr}\0" \ + "bootenvfile=uEnv.txt\0" \ +- "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ ++ "bootenv=uEnv.txt\0" \ ++ "importbootenv=echo Importing environment from ${devtype} ...; " \ + "env import -t ${loadaddr} ${filesize}\0" \ +- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ ++ "loadbootenv=load ${devtype} ${bootpart} ${loadaddr} ${bootenvfile}\0" \ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ +- "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ ++ "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ ++ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ ++ "failumsboot=echo; echo FAILSAFE: U-Boot UMS (USB Mass Storage) enabled, media now available over the usb slave port ...; " \ ++ "ums 0 ${devtype} 1;\0" \ + "envboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ +@@ -44,7 +79,11 @@ + "mmcloados=" \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ +- "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "if test -n ${uname_r}; then " \ ++ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ ++ "else " \ ++ "bootz ${loadaddr} - ${fdtaddr}; " \ ++ "fi; " \ + "else " \ + "if test ${boot_fdt} = try; then " \ + "bootz; " \ +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0002-U-Boot-BeagleBone-Cape-Manager.patch b/board/capu/beagleboneblack/patches/uboot/0002-U-Boot-BeagleBone-Cape-Manager.patch new file mode 100644 index 0000000..f2b21d8 --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0002-U-Boot-BeagleBone-Cape-Manager.patch @@ -0,0 +1,775 @@ +From c71d87ae6a445eb7551957e0aa0d042c7908dbdb Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 21 Oct 2021 16:04:55 -0500 +Subject: [PATCH 2/9] U-Boot-BeagleBone-Cape-Manager + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + board/ti/am335x/board.c | 466 ++++++++++++++++++++++++++++++ + board/ti/am335x/hash-string.h | 59 ++++ + include/configs/ti_armv7_common.h | 153 ++++++++++ + include/environment/ti/mmc.h | 20 ++ + 4 files changed, 698 insertions(+) + create mode 100644 board/ti/am335x/hash-string.h + +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index af0c386e..e69ef49d 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -47,6 +47,7 @@ + #include "../common/board_detect.h" + #include "../common/cape_detect.h" + #include "board.h" ++#include "hash-string.h" + + DECLARE_GLOBAL_DATA_PTR; + +@@ -90,6 +91,463 @@ void do_board_detect(void) + } + #endif + ++#define CAPE_EEPROM_BUS_NUM 2 ++#define CAPE_EEPROM_ADDR0 0x54 ++#define CAPE_EEPROM_ADDR1 0x55 ++#define CAPE_EEPROM_ADDR2 0x56 ++#define CAPE_EEPROM_ADDR3 0x57 ++ ++#define CAPE_EEPROM_ADDR_LEN 0x10 ++ ++#define NOT_POP 0x0 ++#define PINS_TAKEN 0x0 ++ ++#define UNK_BASE_DTB 0x0 ++#define BB_BASE_DTB 0x1 ++#define BBB_BASE_DTB 0x2 ++#define BBGW_BASE_DTB 0x3 ++#define BBBL_BASE_DTB 0x4 ++#define BBE_BASE_DTB 0x5 ++#define BBEL_BASE_DTB 0x6 ++ ++#define BBB_EMMC 0x1 ++ ++#define BBB_TDA998X_AUDIO 0x1 ++#define BBB_TDA998X_NAUDIO 0x2 ++#define BBB_ADV7511_AUDIO 0x3 ++#define BBB_ADV7511_NAUDIO 0x4 ++ ++#define BBBW_WL1835 0x1 ++#define BBGW_WL1835 0x2 ++#define BBGG_WL1835 0x3 ++ ++#define M_BBG1 0x01 ++#define M_OS00 0x02 ++#define M_OS01 0x03 ++#define M_BBGG 0x04 ++ ++static int probe_cape_eeprom(struct am335x_cape_eeprom_id *cape_header) ++{ ++ int ret; ++ struct udevice *dev; ++ unsigned char addr; ++ /* /lib/firmware/BB-CAPE-DISP-CT4-00A0.dtbo */ ++ /* 14 + 16 + 1 + 4 + 5 = 40 */ ++ char hash_cape_overlay[40]; ++ char cape_overlay[26]; ++ char process_cape_part_number[16]; ++ char process_cape_version[4]; ++ char end_part_number; ++ char cape_overlay_pass_to_kernel[18]; ++ ++ //Don't forget about the BeagleBone Classic (White) ++ char base_dtb=UNK_BASE_DTB; ++ char virtual_emmc=NOT_POP; ++ char virtual_video=NOT_POP; ++ char virtual_audio=NOT_POP; ++ char virtual_wireless=NOT_POP; ++ char model=NOT_POP; ++ ++ char *name = NULL; ++ ++ if (board_is_bone_lt()) { ++ puts("BeagleBone Black:\n"); ++ base_dtb=BBB_BASE_DTB; ++ virtual_emmc=BBB_EMMC; ++ virtual_video=BBB_TDA998X_AUDIO; ++ virtual_audio=BBB_TDA998X_AUDIO; ++ virtual_wireless=NOT_POP; ++ name = "A335BNLT"; ++ ++ if (!strncmp(board_ti_get_rev(), "BLA", 3)) { ++ puts("Model: BeagleBoard.org BeagleBone Blue:\n"); ++ /* Special case */ ++ base_dtb=BBBL_BASE_DTB; ++ virtual_emmc=NOT_POP; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ virtual_wireless=NOT_POP; ++ name = "BBBL"; ++ } ++ if (!strncmp(board_ti_get_rev(), "BW", 2)) { ++ puts("Model: BeagleBoard.org BeagleBone Black Wireless:\n"); ++ virtual_wireless=BBBW_WL1835; ++ name = "BBBW"; ++ } ++ if (!strncmp(board_ti_get_rev(), "BBG", 3)) { ++ /* catches again in board_is_bbg1() */ ++ //puts("Model: SeeedStudio BeagleBone Green:\n"); ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ name = "BBG1"; ++ model=M_BBG1; ++ } ++ if (!strncmp(board_ti_get_rev(), "GW1", 3)) { ++ puts("Model: SeeedStudio BeagleBone Green Wireless:\n"); ++ base_dtb=BBGW_BASE_DTB; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ virtual_wireless=BBGW_WL1835; ++ } ++ if (!strncmp(board_ti_get_rev(), "GG1", 3)) { ++ puts("Model: SeeedStudio BeagleBone Green Gateway:\n"); ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ virtual_wireless=BBGG_WL1835; ++ model=M_BBGG; ++ } ++ if (!strncmp(board_ti_get_rev(), "AIA", 3)) { ++ puts("Model: Arrow BeagleBone Black Industrial:\n"); ++ virtual_video=BBB_ADV7511_AUDIO; ++ virtual_audio=BBB_ADV7511_AUDIO; ++ } ++ if (!strncmp(board_ti_get_rev(), "EIA", 3)) { ++ puts("Model: BeagleBone Black Industrial:\n"); ++ } ++ if (!strncmp(board_ti_get_rev(), "SE", 2)) { ++ char subtype_id = board_ti_get_config()[1]; ++ if (subtype_id == 'L') { ++ name = "BBELITE"; ++ base_dtb=BBEL_BASE_DTB; ++ } else { ++ name = "BBEN"; ++ base_dtb=BBE_BASE_DTB; ++ } ++ } ++ if (!strncmp(board_ti_get_rev(), "ME0", 3)) { ++ puts("Model: MENTOREL BeagleBone uSomIQ:\n"); ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ } ++ if (!strncmp(board_ti_get_rev(), "NAD", 3)) { ++ puts("Model: Neuromeka BeagleBone Air:\n"); ++ } ++ if (!strncmp(board_ti_get_rev(), "OS0", 3)) { ++ unsigned char rev = board_ti_get_rev()[3]; ++ puts("Model: Octavo Systems OSD3358-SM-RED:\n"); ++ switch (rev) { ++ case 0x31: /* 1 */ ++ name = "OS01"; ++ model=M_OS01; ++ break; ++ default: /* 0 */ ++ name = "OS00"; ++ model=M_OS00; ++ break; ++ } ++ } ++ } ++ ++ if (board_is_bone()) { ++ puts("Model: BeagleBone:\n"); ++ base_dtb=BB_BASE_DTB; ++ virtual_emmc=NOT_POP; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ virtual_wireless=NOT_POP; ++ name = "A335BONE"; ++ } ++ ++ if (board_is_bbg1()) { ++ puts("Model: SeeedStudio BeagleBone Green:\n"); ++ base_dtb=BBB_BASE_DTB; ++ virtual_emmc=BBB_EMMC; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ virtual_wireless=NOT_POP; ++ name = "BBG1"; ++ model=M_BBG1; ++ } ++ ++ set_board_info_env(name); ++ ++ strlcpy(cape_overlay_pass_to_kernel, "", 1); ++ ++ for ( addr = CAPE_EEPROM_ADDR0; addr <= CAPE_EEPROM_ADDR3; addr++ ) { ++ ret = i2c_get_chip_for_busnum(CAPE_EEPROM_BUS_NUM, addr, 1, &dev); ++ if (ret) { ++ printf("BeagleBone Cape EEPROM: no EEPROM at address: 0x%x\n", addr); ++ } else { ++ printf("BeagleBone Cape EEPROM: found EEPROM at address: 0x%x\n", addr); ++ ++ ret = i2c_set_chip_offset_len(dev, 2); ++ if (ret) { ++ printf("BeagleBone Cape EEPROM: i2c_set_chip_offset_len failure\n"); ++ } ++ ++ ret = dm_i2c_read(dev, 0, (uchar *)cape_header, sizeof(struct am335x_cape_eeprom_id)); ++ if (ret) { ++ printf("BeagleBone Cape EEPROM: Cannot read eeprom params\n"); ++ } ++ ++ if (cape_header->header == 0xEE3355AA) { ++ strlcpy(hash_cape_overlay, "/lib/firmware/", 14 + 1); ++ strlcpy(cape_overlay, "", 2); ++ strlcpy(cape_overlay_pass_to_kernel, "", 2); ++ strlcpy(process_cape_part_number, "...............", 16 + 1); ++ strlcpy(process_cape_version, "...", 4 + 1); ++ ++ strlcpy(process_cape_part_number, cape_header->part_number, 16 + 1); ++ printf("BeagleBone Cape EEPROM: debug part_number field:[%s]\n", process_cape_part_number); ++ ++ //FIXME: some capes end with '.' ++ if ( process_cape_part_number[15] == 0x2E ) { ++ puts("debug: fixup, extra . in eeprom field\n"); ++ process_cape_part_number[15] = 0x00; ++ if ( process_cape_part_number[14] == 0x2E ) { ++ process_cape_part_number[14] = 0x00; ++ } ++ } ++ ++ //Find ending 0x00 or 0xFF ++ puts("BeagleBone Cape EEPROM: debug part_number field HEX:["); ++ end_part_number=16; ++ for ( int i=0; i <= 16; i++ ) { ++ if (( process_cape_part_number[i] == 0x00 ) || ( process_cape_part_number[i] == 0xFF )) { ++ end_part_number=i; ++ i=17; ++ } else { ++ printf("%x", process_cape_part_number[i]); ++ } ++ } ++ puts("]\n"); ++ ++ strncat(cape_overlay_pass_to_kernel, process_cape_part_number, end_part_number); ++ strncat(cape_overlay_pass_to_kernel, ",", 1); ++ //printf("debug: %s\n", cape_overlay_pass_to_kernel); ++ ++ strncat(hash_cape_overlay, process_cape_part_number, end_part_number); ++ strncat(cape_overlay, process_cape_part_number, end_part_number); ++ //printf("debug: %s %s\n", hash_cape_overlay, cape_overlay); ++ ++ strncat(hash_cape_overlay, "-", 1); ++ strncat(cape_overlay, "-", 1); ++ //printf("debug: %s %s\n", hash_cape_overlay, cape_overlay); ++ ++ strlcpy(process_cape_version, cape_header->version, 4 + 1); ++ //printf("debug: version field:[%s]\n", process_cape_version); ++ ++ //Find invalid 0xFF -> 0x30 BBAI FAN Cape... ++ puts("BeagleBone Cape EEPROM: debug version field HEX:["); ++ for ( int i=0; i <= 3; i++ ) { ++ printf("%x", process_cape_version[i]); ++ if ( process_cape_version[i] == 0xFF ) { ++ process_cape_version[i] = 0x30; ++ } ++ } ++ puts("]\n"); ++ ++ strncat(hash_cape_overlay, process_cape_version, 4); ++ strncat(cape_overlay, process_cape_version, 4); ++ //printf("debug: %s %s\n", hash_cape_overlay, cape_overlay); ++ ++ strncat(hash_cape_overlay, ".dtbo", 5); ++ strncat(cape_overlay, ".dtbo", 5); ++ //printf("debug: %s %s\n", hash_cape_overlay, cape_overlay); ++ ++ unsigned long cape_overlay_hash = hash_string(hash_cape_overlay); ++ ++ printf("BeagleBone Cape EEPROM: 0x%x: %s [0x%lx]\n", addr, cape_overlay, cape_overlay_hash); ++ ++ switch(cape_overlay_hash) { ++ case 0x3c766f: /* /lib/firmware/BB-CAPE-DISP-CT4-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0x24f51cf: /* /lib/firmware/BB-BONE-CAM-VVDN-00A0.dtbo */ ++ virtual_emmc=PINS_TAKEN; ++ break; ++ case 0x4b0c13f: /* /lib/firmware/NL-AB-BBCL-00B0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0x74e7bbf: /* /lib/firmware/bb-justboom-dac-00A0.dtbo */ ++ virtual_audio=PINS_TAKEN; ++ break; ++ case 0x93b574f: /* /lib/firmware/BB-GREEN-HDMI-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0x9dcd73f: /* /lib/firmware/BB-BONE-NH10C-01-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xb1b7bbf: /* /lib/firmware/bb-justboom-amp-00A0.dtbo */ ++ virtual_audio=PINS_TAKEN; ++ break; ++ //d15bb ++ case 0xd15b80f: /* /lib/firmware/DLPDLCR2000-00A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xd4c9eff: /* /lib/firmware/bb-justboom-digi-00A0.dtbo */ ++ virtual_audio=PINS_TAKEN; ++ break; ++ case 0xe05061f: /* /lib/firmware/BBORG_DISPLAY70-00A2.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xe3f55df: /* /lib/firmware/BB-BONE-NH7C-01-A0.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfc93c8f: /* /lib/firmware/BB-BONE-LCD7-01-00A3.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe131 ++ case 0xfe1313f: /* /lib/firmware/BB-BONE-4D5R-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe132 ++ case 0xfe1323f: /* /lib/firmware/BB-BONE-4D4R-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe1327f: /* /lib/firmware/BB-BONE-4D4N-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe132cf: /* /lib/firmware/BB-BONE-4D4C-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe133 ++ case 0xfe1337f: /* /lib/firmware/BB-BONE-4D7N-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe133cf: /* /lib/firmware/BB-BONE-4D7C-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe135 ++ case 0xfe1357f: /* /lib/firmware/BB-BONE-4D5N-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe135cf: /* /lib/firmware/BB-BONE-4D5C-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ //fe137 ++ case 0xfe1373f: /* /lib/firmware/BB-BONE-4D7R-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe93c1f: /* /lib/firmware/BB-BONE-LCD4-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ case 0xfe93c2f: /* /lib/firmware/BB-BONE-LCD5-01-00A1.dtbo */ ++ virtual_video=PINS_TAKEN; ++ break; ++ } ++ ++ switch(addr) { ++ case CAPE_EEPROM_ADDR0: ++ env_set("uboot_overlay_addr0", cape_overlay); ++ env_set("uboot_detected_capes_addr0", cape_overlay_pass_to_kernel); ++ break; ++ case CAPE_EEPROM_ADDR1: ++ env_set("uboot_overlay_addr1", cape_overlay); ++ env_set("uboot_detected_capes_addr1", cape_overlay_pass_to_kernel); ++ break; ++ case CAPE_EEPROM_ADDR2: ++ env_set("uboot_overlay_addr2", cape_overlay); ++ env_set("uboot_detected_capes_addr2", cape_overlay_pass_to_kernel); ++ break; ++ case CAPE_EEPROM_ADDR3: ++ env_set("uboot_overlay_addr3", cape_overlay); ++ env_set("uboot_detected_capes_addr3", cape_overlay_pass_to_kernel); ++ break; ++ } ++ env_set("uboot_detected_capes", "1"); ++ } else { ++ printf("BeagleBone Cape EEPROM: EEPROM contents not valid (or blank) on address: 0x%x\n", addr); ++ } ++ } ++ }//for ++ ++ switch(base_dtb) { ++ case BB_BASE_DTB: ++ env_set("uboot_base_dtb_univ", "am335x-bone-uboot-univ.dtb"); ++ env_set("uboot_base_dtb", "am335x-bone.dtb"); ++ break; ++ case BBB_BASE_DTB: ++ env_set("uboot_base_dtb_univ", "am335x-boneblack-uboot-univ.dtb"); ++ env_set("uboot_base_dtb", "am335x-boneblack-uboot.dtb"); ++ break; ++ case BBGW_BASE_DTB: ++ //gpio-hogs and cape-universal dont mesh very well on bootup... ++ env_set("uboot_base_dtb_univ", "am335x-bonegreen-wireless-uboot-univ.dtb"); ++ env_set("uboot_base_dtb", "am335x-boneblack-uboot.dtb"); ++ break; ++ case BBE_BASE_DTB: ++ env_set("uboot_base_dtb_univ", "am335x-sancloud-bbe-uboot-univ.dtb"); ++ env_set("uboot_base_dtb", "am335x-sancloud-bbe-uboot.dtb"); ++ break; ++ case BBEL_BASE_DTB: ++ env_set("uboot_base_dtb_univ", "am335x-sancloud-bbe-lite-uboot-univ.dtb"); ++ env_set("uboot_base_dtb", "am335x-sancloud-bbe-lite-uboot.dtb"); ++ break; ++ case BBBL_BASE_DTB: ++ env_set("uboot_base_dtb_univ", "am335x-boneblue.dtb"); ++ break; ++ } ++ ++ if (virtual_emmc == BBB_EMMC) { ++ env_set("uboot_emmc", "BB-BONE-eMMC1-01-00A0.dtbo"); ++ } ++ ++ switch(virtual_video) { ++ case BBB_TDA998X_AUDIO: ++ if (virtual_audio == PINS_TAKEN) { ++ env_set("uboot_video", "BB-NHDMI-TDA998x-00A0.dtbo"); ++ env_set("uboot_video_naudio", "BB-NHDMI-TDA998x-00A0.dtbo"); ++ } else { ++ env_set("uboot_video", "BB-HDMI-TDA998x-00A0.dtbo"); ++ env_set("uboot_video_naudio", "BB-NHDMI-TDA998x-00A0.dtbo"); ++ } ++ break; ++ case BBB_TDA998X_NAUDIO: ++ env_set("uboot_video", "BB-NHDMI-TDA998x-00A0.dtbo"); ++ env_set("uboot_video_naudio", "BB-NHDMI-TDA998x-00A0.dtbo"); ++ break; ++ case BBB_ADV7511_AUDIO: ++ if (virtual_audio == PINS_TAKEN) { ++ env_set("uboot_video", "BB-NHDMI-ADV7511-00A0.dtbo"); ++ env_set("uboot_video_naudio", "BB-NHDMI-ADV7511-00A0.dtbo"); ++ } else { ++ env_set("uboot_video", "BB-HDMI-ADV7511-00A0.dtbo"); ++ env_set("uboot_video_naudio", "BB-NHDMI-ADV7511-00A0.dtbo"); ++ } ++ break; ++ case BBB_ADV7511_NAUDIO: ++ env_set("uboot_video", "BB-NHDMI-ADV7511-00A0.dtbo"); ++ env_set("uboot_video_naudio", "BB-NHDMI-ADV7511-00A0.dtbo"); ++ break; ++ } ++ ++ switch(virtual_wireless) { ++ case BBBW_WL1835: ++ env_set("uboot_wireless", "BB-BBBW-WL1835-00A0.dtbo"); ++ break; ++ case BBGW_WL1835: ++ env_set("uboot_wireless", "BB-BBGW-WL1835-00A0.dtbo"); ++ break; ++ case BBGG_WL1835: ++ env_set("uboot_wireless", "BB-BBGG-WL1835-00A0.dtbo"); ++ break; ++ } ++ ++ switch(model) { ++ case M_BBG1: ++ env_set("uboot_model", "M-BB-BBG-00A0.dtbo"); ++ break; ++ case M_OS00: ++ env_set("uboot_model", "M-BB-OSD3358-SM-RED-00A0.dtbo"); ++ break; ++ case M_OS01: ++ env_set("uboot_model", "M-BB-OSD3358-SM-RED-00A1.dtbo"); ++ break; ++ case M_BBGG: ++ env_set("uboot_model", "M-BB-BBGG-00A0.dtbo"); ++ break; ++ } ++ return 0; ++} ++ ++void do_cape_detect(void) ++{ ++ struct am335x_cape_eeprom_id cape_header; ++ ++ probe_cape_eeprom(&cape_header); ++} ++ + #ifndef CONFIG_DM_SERIAL + struct serial_device *default_serial_console(void) + { +@@ -976,6 +1434,14 @@ int board_late_init(void) + /* Just probe the potentially supported cdce913 device */ + uclass_get_device_by_name(UCLASS_CLK, "cdce913@65", &dev); + ++#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG ++#ifdef CONFIG_TI_I2C_BOARD_DETECT ++ if (!board_is_pb() && !board_is_beaglelogic()) { ++ do_cape_detect(); ++ } ++#endif ++#endif ++ + return 0; + } + #endif +diff --git a/board/ti/am335x/hash-string.h b/board/ti/am335x/hash-string.h +new file mode 100644 +index 00000000..b267a877 +--- /dev/null ++++ b/board/ti/am335x/hash-string.h +@@ -0,0 +1,59 @@ ++/* Description of GNU message catalog format: string hashing function. ++ Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Library General Public License as published ++ by the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public ++ License along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++ USA. */ ++ ++/* @@ end of prolog @@ */ ++ ++#ifndef PARAMS ++# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES ++# define PARAMS(Args) Args ++# else ++# define PARAMS(Args) () ++# endif ++#endif ++ ++/* We assume to have `unsigned long int' value with at least 32 bits. */ ++#define HASHWORDBITS 32 ++ ++ ++/* Defines the so called `hashpjw' function by P.J. Weinberger ++ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, ++ 1986, 1987 Bell Telephone Laboratories, Inc.] */ ++static unsigned long int hash_string PARAMS ((const char *__str_param)); ++ ++static inline unsigned long int ++hash_string (str_param) ++ const char *str_param; ++{ ++ unsigned long int hval, g; ++ const char *str = str_param; ++ ++ /* Compute the hash value for the given string. */ ++ hval = 0; ++ while (*str != '\0') ++ { ++ hval <<= 4; ++ hval += (unsigned long int) *str++; ++ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); ++ if (g != 0) ++ { ++ hval ^= g >> (HASHWORDBITS - 8); ++ hval ^= g; ++ } ++ } ++ return hval; ++} +diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h +index 78c3d195..1c63c8e6 100644 +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -269,6 +269,40 @@ + "echo loading ${bootdir}/${bootfile} ...; "\ + "run loadimage;" \ + "setenv fdtdir /boot/dtbs/${uname_r}; " \ ++ "echo debug: [enable_uboot_overlays=${enable_uboot_overlays}] ... ;" \ ++ "if test -n ${enable_uboot_overlays}; then " \ ++ "echo debug: [enable_uboot_cape_universal=${enable_uboot_cape_universal}] ... ;" \ ++ "if test -n ${enable_uboot_cape_universal}; then " \ ++ "echo debug: [uboot_base_dtb_univ=${uboot_base_dtb_univ}] ... ;" \ ++ "if test -n ${uboot_base_dtb_univ}; then " \ ++ "echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb_univ}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb_univ}; then " \ ++ "setenv fdtfile ${uboot_base_dtb_univ};" \ ++ "echo uboot_overlays: Switching too: dtb=${fdtfile} ...;" \ ++ "setenv cape_uboot bone_capemgr.uboot_capemgr_enabled=1; " \ ++ "else " \ ++ "echo debug: unable to find [${uboot_base_dtb_univ}] using [${uboot_base_dtb}] instead ... ;" \ ++ "echo debug: [uboot_base_dtb_univ=${uboot_base_dtb}] ... ;" \ ++ "if test -n ${uboot_base_dtb}; then " \ ++ "echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb}; then " \ ++ "setenv fdtfile ${uboot_base_dtb};" \ ++ "echo uboot_overlays: Switching too: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "else " \ ++ "echo debug: [uboot_base_dtb_univ=${uboot_base_dtb}] ... ;" \ ++ "if test -n ${uboot_base_dtb}; then " \ ++ "echo uboot_overlays: [uboot_base_dtb=${uboot_base_dtb}] ... ;" \ ++ "if test -e ${devtype} ${bootpart} ${fdtdir}/${uboot_base_dtb}; then " \ ++ "setenv fdtfile ${uboot_base_dtb};" \ ++ "echo uboot_overlays: Switching too: dtb=${fdtfile} ...;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \ + "run loadfdt;" \ + "else " \ +@@ -309,6 +343,125 @@ + "fi;" \ + "fi;" \ + "fi; " \ ++ "if test -n ${enable_uboot_overlays}; then " \ ++ "extension scan;" \ ++ "setenv fdt_buffer 0x60000;" \ ++ "if test -n ${uboot_fdt_buffer}; then " \ ++ "setenv fdt_buffer ${uboot_fdt_buffer};" \ ++ "fi;" \ ++ "echo uboot_overlays: [fdt_buffer=${fdt_buffer}] ... ;" \ ++ "if test -n ${uboot_silicon}; then " \ ++ "setenv uboot_overlay ${uboot_silicon}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_model}; then " \ ++ "setenv uboot_overlay ${uboot_model}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${disable_uboot_overlay_adc}; then " \ ++ "echo uboot_overlays: uboot loading of [BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay BB-ADC-00A0.dtbo; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr0}; then " \ ++ "if test -n ${disable_uboot_overlay_addr0}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr0}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr0=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr0}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr1}; then " \ ++ "if test -n ${disable_uboot_overlay_addr1}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr1}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr1=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr1}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr2}; then " \ ++ "if test -n ${disable_uboot_overlay_addr2}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr2}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr2=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr2}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr3}; then " \ ++ "if test -n ${disable_uboot_overlay_addr3}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_overlay_addr3}] disabled by /boot/uEnv.txt [disable_uboot_overlay_addr3=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_overlay_addr3}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr4}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr4}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr5}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr5}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr6}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr6}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_addr7}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_addr7}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_emmc}; then " \ ++ "if test -n ${disable_uboot_overlay_emmc}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_emmc}] disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_emmc}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_video}; then " \ ++ "if test -n ${disable_uboot_overlay_video}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_video}] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...;" \ ++ "else " \ ++ "if test -n ${disable_uboot_overlay_audio}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_video}] disabled by /boot/uEnv.txt [disable_uboot_overlay_audio=1]...;" \ ++ "setenv uboot_overlay ${uboot_video_naudio}; " \ ++ "run virtualloadoverlay;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_video}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_wireless}; then " \ ++ "if test -n ${disable_uboot_overlay_wireless}; then " \ ++ "echo uboot_overlays: uboot loading of [${uboot_wireless}] disabled by /boot/uEnv.txt [disable_uboot_overlay_wireless=1]...;" \ ++ "else " \ ++ "setenv uboot_overlay ${uboot_wireless}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_pru}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_pru}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${uboot_overlay_pru_add}; then " \ ++ "setenv uboot_overlay ${uboot_overlay_pru_add}; " \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "if test -n ${dtb_overlay}; then " \ ++ "setenv uboot_overlay ${dtb_overlay}; " \ ++ "echo uboot_overlays: [dtb_overlay=${uboot_overlay}] ... ;" \ ++ "run virtualloadoverlay;" \ ++ "fi;" \ ++ "else " \ ++ "echo uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable...;" \ ++ "fi;" \ ++ "if test -n ${uboot_detected_capes}; then " \ ++ "echo uboot_overlays: [uboot_detected_capes=${uboot_detected_capes_addr0}${uboot_detected_capes_addr1}${uboot_detected_capes_addr2}${uboot_detected_capes_addr3}] ... ;" \ ++ "setenv uboot_detected_capes uboot_detected_capes=${uboot_detected_capes_addr0}${uboot_detected_capes_addr1}${uboot_detected_capes_addr2}${uboot_detected_capes_addr3}; " \ ++ "fi;" \ + "setenv rdfile initrd.img-${uname_r}; " \ + "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \ + "echo loading ${bootdir}/${rdfile} ...; "\ +diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h +index b671c048..030f53fb 100644 +--- a/include/environment/ti/mmc.h ++++ b/include/environment/ti/mmc.h +@@ -58,6 +58,26 @@ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ + "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ ++ "loadoverlay=echo uboot_overlays: loading ${actual_uboot_overlay} ...; " \ ++ "load ${devtype} ${bootpart} ${rdaddr} ${actual_uboot_overlay}; " \ ++ "fdt addr ${fdtaddr}; fdt resize ${fdt_buffer}; " \ ++ "fdt apply ${rdaddr}; fdt resize ${fdt_buffer};\0" \ ++ "virtualloadoverlay=if test -e ${devtype} ${bootpart} ${fdtdir}/overlays/${uboot_overlay}; then " \ ++ "setenv actual_uboot_overlay ${fdtdir}/overlays/${uboot_overlay}; " \ ++ "run loadoverlay;" \ ++ "else " \ ++ "if test -e ${devtype} ${bootpart} /lib/firmware/${uboot_overlay}; then " \ ++ "setenv actual_uboot_overlay /lib/firmware/${uboot_overlay}; " \ ++ "run loadoverlay;" \ ++ "else " \ ++ "if test -e ${devtype} ${bootpart} ${uboot_overlay}; then " \ ++ "setenv actual_uboot_overlay ${uboot_overlay}; " \ ++ "run loadoverlay;" \ ++ "else " \ ++ "echo uboot_overlays: unable to find [${devtype} ${bootpart} ${uboot_overlay}]...;" \ ++ "fi;" \ ++ "fi;" \ ++ "fi;\0" \ + "failumsboot=echo; echo FAILSAFE: U-Boot UMS (USB Mass Storage) enabled, media now available over the usb slave port ...; " \ + "ums 0 ${devtype} 1;\0" \ + "envboot=mmc dev ${mmcdev}; " \ +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0003-am335x-board.c-BBE-Lite-has-no-HDMI-encoder.patch b/board/capu/beagleboneblack/patches/uboot/0003-am335x-board.c-BBE-Lite-has-no-HDMI-encoder.patch new file mode 100644 index 0000000..a3857aa --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0003-am335x-board.c-BBE-Lite-has-no-HDMI-encoder.patch @@ -0,0 +1,26 @@ +From 6b96304dc13a66425c0f5818da9fa3769f52e026 Mon Sep 17 00:00:00 2001 +From: Paul Barker <paul.barker@sancloud.com> +Date: Sat, 25 Sep 2021 14:43:20 +0100 +Subject: [PATCH 3/9] am335x/board.c: BBE Lite has no HDMI encoder + +Signed-off-by: Paul Barker <paul.barker@sancloud.com> +--- + board/ti/am335x/board.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index e69ef49d..0f7759be 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -209,6 +209,8 @@ static int probe_cape_eeprom(struct am335x_cape_eeprom_id *cape_header) + if (subtype_id == 'L') { + name = "BBELITE"; + base_dtb=BBEL_BASE_DTB; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; + } else { + name = "BBEN"; + base_dtb=BBE_BASE_DTB; +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0004-fix-am335x-osd3358-sm-red-v4.dtb-name.patch b/board/capu/beagleboneblack/patches/uboot/0004-fix-am335x-osd3358-sm-red-v4.dtb-name.patch new file mode 100644 index 0000000..a90c7b8 --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0004-fix-am335x-osd3358-sm-red-v4.dtb-name.patch @@ -0,0 +1,35 @@ +From 1776850cda930fd23fec693fb1b499b927c9a596 Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Tue, 26 Oct 2021 09:46:05 -0500 +Subject: [PATCH 4/9] fix am335x-osd3358-sm-red-v4.dtb name + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + include/configs/am335x_evm.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index b5e5f2dc..0daedb42 100644 +--- a/include/configs/am335x_evm.h ++++ b/include/configs/am335x_evm.h +@@ -181,7 +181,7 @@ + "elif test $board_rev = OS00; then " \ + "setenv fdtfile am335x-osd3358-sm-red.dtb; " \ + "elif test $board_rev = OS01; then " \ +- "setenv fdtfile am335x-osd3358-sm-red-01.dtb; " \ ++ "setenv fdtfile am335x-osd3358-sm-red-v4.dtb; " \ + "else " \ + "setenv fdtfile am335x-boneblack.dtb; " \ + "fi; " \ +@@ -205,7 +205,7 @@ + "if test $board_name = OS00; then " \ + "setenv fdtfile am335x-osd3358-sm-red.dtb; fi; " \ + "if test $board_name = OS01; then " \ +- "setenv fdtfile am335x-osd3358-sm-red-01.dtb; fi; " \ ++ "setenv fdtfile am335x-osd3358-sm-red-v4.dtb; fi; " \ + "if test $board_name = A33515BB; then " \ + "setenv fdtfile am335x-evm.dtb; fi; " \ + "if test $board_name = A335X_SK; then " \ +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0005-am335x-Add-support-for-SanCloud-BBE-Extended-WiFi-bo.patch b/board/capu/beagleboneblack/patches/uboot/0005-am335x-Add-support-for-SanCloud-BBE-Extended-WiFi-bo.patch new file mode 100644 index 0000000..336cd8d --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0005-am335x-Add-support-for-SanCloud-BBE-Extended-WiFi-bo.patch @@ -0,0 +1,103 @@ +From 908b0c58921326aecc799b57f6a93a0a3e61132a Mon Sep 17 00:00:00 2001 +From: Paul Barker <paul.barker@sancloud.com> +Date: Mon, 13 Dec 2021 09:28:42 +0000 +Subject: [PATCH 5/9] am335x: Add support for SanCloud BBE Extended WiFi boards + +Signed-off-by: Paul Barker <paul.barker@sancloud.com> +--- + board/ti/am335x/board.c | 44 ++++++++++++++++++++++++------------ + include/configs/am335x_evm.h | 2 ++ + 2 files changed, 32 insertions(+), 14 deletions(-) + +diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c +index 0f7759be..b3dc974b 100644 +--- a/board/ti/am335x/board.c ++++ b/board/ti/am335x/board.c +@@ -109,6 +109,7 @@ void do_board_detect(void) + #define BBBL_BASE_DTB 0x4 + #define BBE_BASE_DTB 0x5 + #define BBEL_BASE_DTB 0x6 ++#define BBE_EX_WIFI_BASE_DTB 0x7 + + #define BBB_EMMC 0x1 + +@@ -206,14 +207,22 @@ static int probe_cape_eeprom(struct am335x_cape_eeprom_id *cape_header) + } + if (!strncmp(board_ti_get_rev(), "SE", 2)) { + char subtype_id = board_ti_get_config()[1]; +- if (subtype_id == 'L') { +- name = "BBELITE"; +- base_dtb=BBEL_BASE_DTB; +- virtual_video=NOT_POP; +- virtual_audio=NOT_POP; +- } else { +- name = "BBEN"; +- base_dtb=BBE_BASE_DTB; ++ switch (subtype_id) { ++ case 'L': ++ name = "BBELITE"; ++ base_dtb=BBEL_BASE_DTB; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ break; ++ case 'I': ++ name = "BBE_EX_WIFI"; ++ base_dtb=BBE_EX_WIFI_BASE_DTB; ++ virtual_video=NOT_POP; ++ virtual_audio=NOT_POP; ++ break; ++ default: ++ name = "BBEN"; ++ base_dtb=BBE_BASE_DTB; + } + } + if (!strncmp(board_ti_get_rev(), "ME0", 3)) { +@@ -476,6 +485,10 @@ static int probe_cape_eeprom(struct am335x_cape_eeprom_id *cape_header) + env_set("uboot_base_dtb_univ", "am335x-sancloud-bbe-lite-uboot-univ.dtb"); + env_set("uboot_base_dtb", "am335x-sancloud-bbe-lite-uboot.dtb"); + break; ++ case BBE_EX_WIFI_BASE_DTB: ++ env_set("uboot_base_dtb_univ", "am335x-sancloud-bbe-extended-wifi-uboot-univ.dtb"); ++ env_set("uboot_base_dtb", "am335x-sancloud-bbe-extended-wifi-uboot.dtb"); ++ break; + case BBBL_BASE_DTB: + env_set("uboot_base_dtb_univ", "am335x-boneblue.dtb"); + break; +@@ -1363,12 +1376,15 @@ int board_late_init(void) + + if (board_is_bben()) { + char subtype_id = board_ti_get_config()[1]; +- if (subtype_id == 'L') { +- puts("Model: Sancloud BeagleBone Enhanced Lite (BBE Lite)\n"); +- name = "BBELITE"; +- } else { +- puts("Model: SanCloud BeagleBone Enhanced\n"); +- name = "BBEN"; ++ switch (subtype_id) { ++ case 'L': ++ name = "BBELITE"; ++ break; ++ case 'I': ++ name = "BBE_EX_WIFI"; ++ break; ++ default: ++ name = "BBEN"; + } + } + +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index 0daedb42..778f4994 100644 +--- a/include/configs/am335x_evm.h ++++ b/include/configs/am335x_evm.h +@@ -202,6 +202,8 @@ + "setenv fdtfile am335x-sancloud-bbe.dtb; fi; " \ + "if test $board_name = BBELITE; then " \ + "setenv fdtfile am335x-sancloud-bbe-lite.dtb; fi; " \ ++ "if test $board_name = BBE_EX_WIFI; then " \ ++ "setenv fdtfile am335x-sancloud-bbe-extended-wifi.dtb; fi; " \ + "if test $board_name = OS00; then " \ + "setenv fdtfile am335x-osd3358-sm-red.dtb; fi; " \ + "if test $board_name = OS01; then " \ +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0006-add-quick-build-file.patch b/board/capu/beagleboneblack/patches/uboot/0006-add-quick-build-file.patch new file mode 100644 index 0000000..20d228a --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0006-add-quick-build-file.patch @@ -0,0 +1,55 @@ +From 3020bf6f471f266e868419ff0214bb62ad0ce420 Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 27 Jan 2022 18:32:47 -0600 +Subject: [PATCH 6/9] add quick build file + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + build-am335x_evm.sh | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + create mode 100755 build-am335x_evm.sh + +diff --git a/build-am335x_evm.sh b/build-am335x_evm.sh +new file mode 100755 +index 00000000..5796f3c3 +--- /dev/null ++++ b/build-am335x_evm.sh +@@ -0,0 +1,35 @@ ++#!/bin/bash ++ ++sys=$(uname -m) ++ ++#add: bc bison flex libssl-dev u-boot-tools binutils gcc ++ ++DIR="$PWD" ++ ++if [ "x${sys}" = "xarmv7l" ] ; then ++ if [ ! -f ./load.menuconfig ] ; then ++ echo "Developers: too make changes: [touch load.menuconfig]" ++ fi ++fi ++ ++make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean ++ ++if [ "x${sys}" = "xarmv7l" ] ; then ++ if [ -f ./load.menuconfig ] ; then ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_defconfig ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- savedefconfig ++ cp -v defconfig ./configs/am335x_evm_defconfig ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean ++ fi ++ ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_defconfig ++ make ARCH=arm -j2 CROSS_COMPILE=arm-linux-gnueabihf- ++else ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_defconfig ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig ++ make ARCH=arm -j2 CROSS_COMPILE=arm-linux-gnueabihf- ++ ++ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- savedefconfig ++ cp -v defconfig ./configs/am335x_evm_defconfig ++fi +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0008-add-install-file.patch b/board/capu/beagleboneblack/patches/uboot/0008-add-install-file.patch new file mode 100644 index 0000000..45ad59e --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0008-add-install-file.patch @@ -0,0 +1,50 @@ +From 87435088c9df6f1c183cc32ee698b4e8073a0d41 Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 27 Jan 2022 18:38:45 -0600 +Subject: [PATCH 8/9] add install file + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + install-am335x.sh | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + create mode 100755 install-am335x.sh + +diff --git a/install-am335x.sh b/install-am335x.sh +new file mode 100755 +index 00000000..4eab6270 +--- /dev/null ++++ b/install-am335x.sh +@@ -0,0 +1,30 @@ ++#!/bin/bash ++ ++if ! id | grep -q root; then ++ echo "must be run as root" ++ exit ++fi ++ ++sys=$(uname -m) ++ ++wdir="$PWD" ++ ++if [ "x${sys}" = "xarmv7l" ] ; then ++ if [ -f ${wdir}/MLO ] && [ -f ${wdir}/u-boot-dtb.img ] ++ if [ -b /dev/mmcblk0 ] ; then ++ echo "dd if=${wdir}/MLO of=/dev/mmcblk0 count=2 seek=1 bs=128k" ++ dd if=${wdir}/MLO of=/dev/mmcblk0 count=2 seek=1 bs=128k ++ echo "dd if=${wdir}/u-boot-dtb.img of=/dev/mmcblk0 count=4 seek=1 bs=384k" ++ dd if=${wdir}/u-boot-dtb.img of=/dev/mmcblk0 count=4 seek=1 bs=384k ++ fi ++ ++ if [ -b /dev/mmcblk1 ] ; then ++ echo "dd if=${wdir}/MLO of=/dev/mmcblk1 count=2 seek=1 bs=128k" ++ dd if=${wdir}/MLO of=/dev/mmcblk1 count=2 seek=1 bs=128k ++ echo "dd if=${wdir}/u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k" ++ dd if=${wdir}/u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k ++ fi ++ else ++ echo "Run build-am335x.sh first" ++ fi ++fi +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/patches/uboot/0009-fix-install.sh.patch b/board/capu/beagleboneblack/patches/uboot/0009-fix-install.sh.patch new file mode 100644 index 0000000..3b36c50 --- /dev/null +++ b/board/capu/beagleboneblack/patches/uboot/0009-fix-install.sh.patch @@ -0,0 +1,26 @@ +From 6988a0462268858874dcc1801aa65450e572fab1 Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 27 Jan 2022 19:07:16 -0600 +Subject: [PATCH 9/9] fix: install.sh + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + install-am335x.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/install-am335x.sh b/install-am335x.sh +index 4eab6270..e58d5fd0 100755 +--- a/install-am335x.sh ++++ b/install-am335x.sh +@@ -10,7 +10,7 @@ sys=$(uname -m) + wdir="$PWD" + + if [ "x${sys}" = "xarmv7l" ] ; then +- if [ -f ${wdir}/MLO ] && [ -f ${wdir}/u-boot-dtb.img ] ++ if [ -f ${wdir}/MLO ] && [ -f ${wdir}/u-boot-dtb.img ] ; then + if [ -b /dev/mmcblk0 ] ; then + echo "dd if=${wdir}/MLO of=/dev/mmcblk0 count=2 seek=1 bs=128k" + dd if=${wdir}/MLO of=/dev/mmcblk0 count=2 seek=1 bs=128k +-- +2.30.2 + diff --git a/board/capu/beagleboneblack/rootfs-overlay/boot/uEnv.txt b/board/capu/beagleboneblack/rootfs-overlay/boot/uEnv.txt new file mode 100644 index 0000000..752288f --- /dev/null +++ b/board/capu/beagleboneblack/rootfs-overlay/boot/uEnv.txt @@ -0,0 +1,3 @@ +uname_r=custom +enable_uboot_overlays=1 +uboot_overlay_addr4=BB-VIEW-LCD4-01-00A0.dtbo diff --git a/board/capu/beagleboneblack/rootfs-overlay/etc/X11/xorg.conf b/board/capu/beagleboneblack/rootfs-overlay/etc/X11/xorg.conf new file mode 100644 index 0000000..dad9f18 --- /dev/null +++ b/board/capu/beagleboneblack/rootfs-overlay/etc/X11/xorg.conf @@ -0,0 +1,22 @@ +Section "Monitor" + Identifier "Builtin Default Monitor" +EndSection + +Section "Device" + Identifier "Builtin Default fbdev Device 0" + Driver "fbdev" + Option "Rotate" "CW" +#HWcursor_false Option "HWcursor" "false" +EndSection + +Section "Screen" + Identifier "Builtin Default fbdev Screen 0" + Device "Builtin Default fbdev Device 0" + Monitor "Builtin Default Monitor" + DefaultDepth 24 +EndSection + +Section "ServerLayout" + Identifier "Builtin Default Layout" + Screen "Builtin Default fbdev Screen 0" +EndSection diff --git a/board/capu/beagleboneblack/rootfs-overlay/etc/X11/xorg.conf.d/99-calibration.conf b/board/capu/beagleboneblack/rootfs-overlay/etc/X11/xorg.conf.d/99-calibration.conf new file mode 100644 index 0000000..d74b17e --- /dev/null +++ b/board/capu/beagleboneblack/rootfs-overlay/etc/X11/xorg.conf.d/99-calibration.conf @@ -0,0 +1,9 @@ +Section "InputClass" + Identifier "calibration" + MatchProduct "ti-tsc" + Option "Calibration" "3954 200 3658 346" + Option "SwapAxes" "1" + Option "InvertX" "0" + Option "InvertY" "1" +EndSection + diff --git a/board/capu/beagleboneblack/rootfs-overlay/etc/network/network b/board/capu/beagleboneblack/rootfs-overlay/etc/network/network new file mode 100644 index 0000000..f743d69 --- /dev/null +++ b/board/capu/beagleboneblack/rootfs-overlay/etc/network/network @@ -0,0 +1,7 @@ +auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet static + address 192.168.0.2 + netmask 255.255.255.0 diff --git a/board/capu/beagleboneblack/rootfs-overlay/usr/share/X11/xorg.conf.d/80-tslib.conf b/board/capu/beagleboneblack/rootfs-overlay/usr/share/X11/xorg.conf.d/80-tslib.conf new file mode 100644 index 0000000..d9eafbc --- /dev/null +++ b/board/capu/beagleboneblack/rootfs-overlay/usr/share/X11/xorg.conf.d/80-tslib.conf @@ -0,0 +1,12 @@ +# cat /usr/share/X11/xorg.conf.d/80-tslib.conf +# +# Catch-all tslib loader for udev-based systems +# +# We match on all touchscreen devices. If you have multiple, please specify. + +#Section "InputClass" +# Identifier "tslib touchscreen catchall" +# MatchIsTouchscreen "on" +# MatchDevicePath "/dev/input/*" +# Driver "tslib" +#EndSection |
