Merge tag 'ti-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti
- Enabled distro boot for all TI platforms. - Cleanup for AM335x Guardian Board - PRUSS rproc on AM65 platform. - Add PMIC support for J7200 - Misc fixes for Nokia RX-51 # Conflicts: # arch/arm/mach-omap2/am33xx/Kconfig
This commit is contained in:
@@ -50,15 +50,6 @@
|
||||
#define NANDARGS ""
|
||||
#endif
|
||||
|
||||
#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
|
||||
"bootcmd_" #devtypel #instance "=" \
|
||||
"setenv mmcdev " #instance"; "\
|
||||
"setenv bootpart " #instance":2 ; "\
|
||||
"run mmcboot\0"
|
||||
|
||||
#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
|
||||
#devtypel #instance " "
|
||||
|
||||
#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
|
||||
"bootcmd_" #devtypel "=" \
|
||||
"run nandboot\0"
|
||||
@@ -86,9 +77,7 @@
|
||||
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
func(MMC, mmc, 0) \
|
||||
func(LEGACY_MMC, legacy_mmc, 0) \
|
||||
func(MMC, mmc, 1) \
|
||||
func(LEGACY_MMC, legacy_mmc, 1) \
|
||||
func(NAND, nand, 0) \
|
||||
BOOT_TARGET_USB(func) \
|
||||
BOOT_TARGET_PXE(func) \
|
||||
@@ -98,16 +87,11 @@
|
||||
|
||||
#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 \
|
||||
DEFAULT_FIT_TI_ARGS \
|
||||
"bootpart=0:2\0" \
|
||||
"bootdir=/boot\0" \
|
||||
"bootfile=zImage\0" \
|
||||
"fdtfile=undefined\0" \
|
||||
"finduuid=part uuid mmc 0:2 uuid\0" \
|
||||
"console=ttyO0,115200n8\0" \
|
||||
"partitions=" \
|
||||
"uuid_disk=${uuid_gpt_disk};" \
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#define MEM_LAYOUT_ENV_SETTINGS \
|
||||
"scriptaddr=0x80000000\0" \
|
||||
"pxefile_addr_r=0x80100000\0" \
|
||||
"tftp_load_addr=0x82000000\0" \
|
||||
"kernel_addr_r=0x82000000\0" \
|
||||
"fdt_addr_r=0x88000000\0" \
|
||||
"ramdisk_addr_r=0x88080000\0" \
|
||||
@@ -57,19 +58,20 @@
|
||||
MEM_LAYOUT_ENV_SETTINGS \
|
||||
BOOTENV \
|
||||
GUARDIAN_DEFAULT_PROD_ENV \
|
||||
"autoload=no\0" \
|
||||
"backlight_brightness=50\0" \
|
||||
"bootubivol=rootfs\0" \
|
||||
"distro_bootcmd=" \
|
||||
"setenv autoload no; " \
|
||||
"setenv rootflags \"bulk_read,chk_data_crc\"; " \
|
||||
"setenv ethact usb_ether; " \
|
||||
"if test \"${swi_status}\" -eq 1; then " \
|
||||
"setenv extrabootargs \"swi_attached\"; " \
|
||||
"if dhcp; then " \
|
||||
"sleep 1; " \
|
||||
"if tftp \"${tftp_load_addr}\" \"bootscript.scr\"; then " \
|
||||
"source \"${tftp_load_addr}\"; " \
|
||||
"fi; " \
|
||||
"fi; " \
|
||||
"setenv extrabootargs $extrabootargs \"swi_attached\"; " \
|
||||
"fi;" \
|
||||
"run bootcmd_ubifs0;\0" \
|
||||
"altbootcmd=" \
|
||||
@@ -80,6 +82,17 @@
|
||||
|
||||
#endif /* ! CONFIG_SPL_BUILD */
|
||||
|
||||
#define CONFIG_BMP_16BPP
|
||||
#define SPLASH_SCREEN_NAND_PART "nand0,10"
|
||||
#define SPLASH_SCREEN_BMP_FILE_SIZE 0x26000
|
||||
#define SPLASH_SCREEN_BMP_LOAD_ADDR 0x82000000
|
||||
#define SPLASH_SCREEN_TEXT "U-Boot"
|
||||
|
||||
/* BGR 16Bit Color Definitions */
|
||||
#define CONSOLE_COLOR_BLACK 0x0000
|
||||
#define CONSOLE_COLOR_WHITE 0xFFFF
|
||||
#define CONSOLE_COLOR_RED 0x001F
|
||||
|
||||
/* NS16550 Configuration */
|
||||
#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
|
||||
#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
|
||||
|
||||
@@ -108,59 +108,41 @@
|
||||
#define DFUARGS
|
||||
#endif
|
||||
|
||||
#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
|
||||
"bootcmd_" #devtypel "=" \
|
||||
"run nandboot\0"
|
||||
|
||||
#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
|
||||
#devtypel #instance " "
|
||||
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
func(MMC, mmc, 0) \
|
||||
func(USB, usb, 0) \
|
||||
func(NAND, nand, 0) \
|
||||
func(PXE, pxe, na) \
|
||||
func(DHCP, dhcp, na)
|
||||
|
||||
#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 \
|
||||
DEFAULT_FIT_TI_ARGS \
|
||||
"fdtfile=undefined\0" \
|
||||
"bootpart=0:2\0" \
|
||||
"bootdir=/boot\0" \
|
||||
"bootfile=zImage\0" \
|
||||
"finduuid=part uuid mmc 0:2 uuid\0" \
|
||||
"console=ttyO0,115200n8\0" \
|
||||
"partitions=" \
|
||||
"uuid_disk=${uuid_gpt_disk};" \
|
||||
"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
|
||||
"optargs=\0" \
|
||||
"usbroot=/dev/sda2 rw\0" \
|
||||
"usbrootfstype=ext4 rootwait\0" \
|
||||
"usbdev=0\0" \
|
||||
"ramroot=/dev/ram0 rw\0" \
|
||||
"ramrootfstype=ext2\0" \
|
||||
"usbargs=setenv bootargs console=${console} " \
|
||||
"${optargs} " \
|
||||
"root=${usbroot} " \
|
||||
"rootfstype=${usbrootfstype}\0" \
|
||||
"ramargs=setenv bootargs console=${console} " \
|
||||
"${optargs} " \
|
||||
"root=${ramroot} " \
|
||||
"rootfstype=${ramrootfstype}\0" \
|
||||
"loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \
|
||||
"usbboot=" \
|
||||
"setenv devnum ${usbdev}; " \
|
||||
"setenv devtype usb; " \
|
||||
"usb start ${usbdev}; " \
|
||||
"if usb dev ${usbdev}; then " \
|
||||
"if run loadbootenv; then " \
|
||||
"echo Loaded environment from ${bootenv};" \
|
||||
"run importbootenv;" \
|
||||
"fi;" \
|
||||
"if test -n $uenvcmd; then " \
|
||||
"echo Running uenvcmd ...;" \
|
||||
"run uenvcmd;" \
|
||||
"fi;" \
|
||||
"if run loadimage; then " \
|
||||
"run loadfdt; " \
|
||||
"echo Booting from usb ${usbdev}...; " \
|
||||
"run usbargs;" \
|
||||
"bootz ${loadaddr} - ${fdtaddr}; " \
|
||||
"fi;" \
|
||||
"fi\0" \
|
||||
"fi;" \
|
||||
"usb stop ${usbdev};\0" \
|
||||
"findfdt="\
|
||||
"if test $board_name = AM43EPOS; then " \
|
||||
"setenv fdtfile am43x-epos-evm.dtb; fi; " \
|
||||
@@ -177,16 +159,7 @@
|
||||
NANDARGS \
|
||||
NETARGS \
|
||||
DFUARGS \
|
||||
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
"if test ${boot_fit} -eq 1; then " \
|
||||
"run update_to_fit;" \
|
||||
"fi;" \
|
||||
"run findfdt; " \
|
||||
"run envboot;" \
|
||||
"run mmcboot;" \
|
||||
"run usbboot;" \
|
||||
NANDBOOT \
|
||||
BOOTENV
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#define __CONFIG_AM654_EVM_H
|
||||
|
||||
#include <linux/sizes.h>
|
||||
#include <config_distro_bootcmd.h>
|
||||
#include <environment/ti/mmc.h>
|
||||
#include <environment/ti/k3_rproc.h>
|
||||
#include <environment/ti/k3_dfu.h>
|
||||
@@ -126,6 +125,16 @@
|
||||
DFU_ALT_INFO_EMMC \
|
||||
DFU_ALT_INFO_OSPI
|
||||
|
||||
#ifdef CONFIG_TARGET_AM654_A53_EVM
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
func(MMC, mmc, 1) \
|
||||
func(MMC, mmc, 0)
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
#else
|
||||
#define BOOTENV
|
||||
#endif
|
||||
|
||||
/* Incorporate settings into the U-Boot environment */
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
DEFAULT_LINUX_BOOT_ENV \
|
||||
@@ -136,7 +145,8 @@
|
||||
EXTRA_ENV_AM65X_BOARD_SETTINGS_MTD \
|
||||
EXTRA_ENV_AM65X_BOARD_SETTINGS_UBI \
|
||||
EXTRA_ENV_RPROC_SETTINGS \
|
||||
EXTRA_ENV_DFUARGS
|
||||
EXTRA_ENV_DFUARGS \
|
||||
BOOTENV
|
||||
|
||||
#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#define __CONFIG_J721E_EVM_H
|
||||
|
||||
#include <linux/sizes.h>
|
||||
#include <config_distro_bootcmd.h>
|
||||
#include <environment/ti/mmc.h>
|
||||
#include <environment/ti/k3_rproc.h>
|
||||
#include <environment/ti/ufs.h>
|
||||
@@ -160,6 +159,26 @@
|
||||
#define EXTRA_ENV_J721E_BOARD_SETTINGS_MTD
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(CMD_PXE)
|
||||
# define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
|
||||
#else
|
||||
# define BOOT_TARGET_PXE(func)
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(CMD_DHCP)
|
||||
# define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
|
||||
#else
|
||||
# define BOOT_TARGET_DHCP(func)
|
||||
#endif
|
||||
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
func(MMC, mmc, 1) \
|
||||
func(MMC, mmc, 0) \
|
||||
BOOT_TARGET_PXE(func) \
|
||||
BOOT_TARGET_DHCP(func)
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
|
||||
/* Incorporate settings into the U-Boot environment */
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
DEFAULT_LINUX_BOOT_ENV \
|
||||
@@ -170,7 +189,8 @@
|
||||
EXTRA_ENV_RPROC_SETTINGS \
|
||||
EXTRA_ENV_DFUARGS \
|
||||
DEFAULT_UFS_TI_ARGS \
|
||||
EXTRA_ENV_J721E_BOARD_SETTINGS_MTD
|
||||
EXTRA_ENV_J721E_BOARD_SETTINGS_MTD \
|
||||
BOOTENV
|
||||
|
||||
/* Now for the remaining common defines */
|
||||
#include <configs/ti_armv7_common.h>
|
||||
|
||||
@@ -129,32 +129,22 @@ int rx51_kp_getc(struct stdio_dev *sdev);
|
||||
"scriptboot=echo Running ${mmcscriptfile} from mmc " \
|
||||
"${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
|
||||
"kernboot=echo Booting ${mmckernfile} from mmc " \
|
||||
"${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
|
||||
"${mmcnum}:${mmcpart} ...; bootm ${kernaddr} || " \
|
||||
"bootz ${kernaddr}\0" \
|
||||
"kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
|
||||
"${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
|
||||
"${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr} || " \
|
||||
"bootz ${kernaddr} ${initrdaddr}\0" \
|
||||
"attachboot=echo Booting attached kernel image ...;" \
|
||||
"setenv setup_omap_atag 1;" \
|
||||
"bootm ${attkernaddr};" \
|
||||
"bootm ${attkernaddr} || bootz ${attkernaddr};" \
|
||||
"setenv setup_omap_atag\0" \
|
||||
"trymmcscriptboot=if run switchmmc; then " \
|
||||
"if run scriptload; then " \
|
||||
"run scriptboot;" \
|
||||
"fi;" \
|
||||
"fi\0" \
|
||||
"trymmckernboot=if run switchmmc; then " \
|
||||
"if run kernload; then " \
|
||||
"run kernboot;" \
|
||||
"fi;" \
|
||||
"fi\0" \
|
||||
"trymmckerninitrdboot=if run switchmmc; then " \
|
||||
"if run initrdload; then " \
|
||||
"if run kernload; then " \
|
||||
"run kerninitrdboot;" \
|
||||
"fi;" \
|
||||
"fi; " \
|
||||
"fi\0" \
|
||||
"trymmcscriptboot=run switchmmc && run scriptload && run scriptboot\0" \
|
||||
"trymmckernboot=run switchmmc && run kernload && run kernboot\0" \
|
||||
"trymmckerninitrdboot=run switchmmc && run initrdload && " \
|
||||
"run kernload && run kerninitrdboot\0" \
|
||||
"trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
|
||||
"setenv mmckernfile uImage; run trymmckernboot\0" \
|
||||
"setenv mmckernfile uImage; run trymmckernboot;" \
|
||||
"setenv mmckernfile zImage; run trymmckernboot\0" \
|
||||
"trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
|
||||
"setenv mmcpart 2; run trymmcpartboot;" \
|
||||
"setenv mmcpart 3; run trymmcpartboot;" \
|
||||
@@ -167,15 +157,11 @@ int rx51_kp_getc(struct stdio_dev *sdev);
|
||||
"fi\0" \
|
||||
"emmcboot=setenv mmcnum 1; run trymmcboot\0" \
|
||||
"sdboot=setenv mmcnum 0; run trymmcboot\0" \
|
||||
"preboot=setenv mmcnum 1; setenv mmcpart 1;" \
|
||||
"setenv mmcscriptfile bootmenu.scr;" \
|
||||
"if run switchmmc; then " \
|
||||
"setenv mmctype fat;" \
|
||||
"if run scriptload; then run scriptboot; else " \
|
||||
"setenv mmctype ext4;" \
|
||||
"if run scriptload; then run scriptboot; fi;" \
|
||||
"fi;" \
|
||||
"fi;" \
|
||||
"trymmcbootmenu=setenv mmctype fat && run trymmcscriptboot || " \
|
||||
"setenv mmctype ext4 && run trymmcscriptboot\0" \
|
||||
"preboot=setenv mmcpart 1; setenv mmcscriptfile bootmenu.scr;" \
|
||||
"setenv mmcnum 0 && run trymmcbootmenu || " \
|
||||
"setenv mmcnum 1 && run trymmcbootmenu;" \
|
||||
"if run slide; then true; else " \
|
||||
"setenv bootmenu_delay 0;" \
|
||||
"setenv bootdelay 0;" \
|
||||
|
||||
@@ -51,12 +51,6 @@
|
||||
#define CONFIG_TWL6030_POWER 1
|
||||
#endif
|
||||
|
||||
/* USB */
|
||||
|
||||
/* USB device configuration */
|
||||
#define CONFIG_USB_DEVICE 1
|
||||
#define CONFIG_USB_TTY 1
|
||||
|
||||
/*
|
||||
* Environment setup
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#define CONFIG_PALMAS_POWER
|
||||
|
||||
#include <linux/stringify.h>
|
||||
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/arch/omap.h>
|
||||
|
||||
@@ -54,10 +56,233 @@
|
||||
#define DFUARGS
|
||||
#endif
|
||||
|
||||
#include <environment/ti/boot.h>
|
||||
#include <environment/ti/mmc.h>
|
||||
#include <environment/ti/nand.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" \
|
||||
"finduuid=part uuid mmc 0:2 uuid\0" \
|
||||
"usbtty=cdc_acm\0" \
|
||||
"vram=16M\0" \
|
||||
AVB_VERIFY_CMD \
|
||||
"partitions=" PARTS_DEFAULT "\0" \
|
||||
"optargs=\0" \
|
||||
"dofastboot=0\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"
|
||||
|
||||
#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 finduuid; " \
|
||||
"run distro_bootcmd;" \
|
||||
"run emmc_android_boot; " \
|
||||
""
|
||||
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
func(MMC, mmc, 0) \
|
||||
func(MMC, mmc, 1) \
|
||||
func(PXE, pxe, na) \
|
||||
func(DHCP, dhcp, na)
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
DEFAULT_LINUX_BOOT_ENV \
|
||||
DEFAULT_MMC_TI_ARGS \
|
||||
@@ -67,6 +292,7 @@
|
||||
DFUARGS \
|
||||
NETARGS \
|
||||
NANDARGS \
|
||||
BOOTENV
|
||||
|
||||
/*
|
||||
* SPL related defines. The Public RAM memory map the ROM defines the
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
/* 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 */
|
||||
227
include/linux/pruss_driver.h
Normal file
227
include/linux/pruss_driver.h
Normal file
@@ -0,0 +1,227 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef __TI_PRUSS_H
|
||||
#define __TI_PRUSS_H
|
||||
|
||||
/*
|
||||
* PRU_ICSS_CFG registers
|
||||
* SYSCFG, ISRP, ISP, IESP, IECP, SCRP applicable on AMxxxx devices only
|
||||
*/
|
||||
#define PRUSS_CFG_REVID 0x00
|
||||
#define PRUSS_CFG_SYSCFG 0x04
|
||||
#define PRUSS_CFG_GPCFG(x) (0x08 + (x) * 4)
|
||||
#define PRUSS_CFG_CGR 0x10
|
||||
#define PRUSS_CFG_ISRP 0x14
|
||||
#define PRUSS_CFG_ISP 0x18
|
||||
#define PRUSS_CFG_IESP 0x1C
|
||||
#define PRUSS_CFG_IECP 0x20
|
||||
#define PRUSS_CFG_SCRP 0x24
|
||||
#define PRUSS_CFG_PMAO 0x28
|
||||
#define PRUSS_CFG_MII_RT 0x2C
|
||||
#define PRUSS_CFG_IEPCLK 0x30
|
||||
#define PRUSS_CFG_SPP 0x34
|
||||
#define PRUSS_CFG_PIN_MX 0x40
|
||||
|
||||
/* PRUSS_GPCFG register bits */
|
||||
#define PRUSS_GPCFG_PRU_GPO_SH_SEL BIT(25)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_DIV1_SHIFT 20
|
||||
#define PRUSS_GPCFG_PRU_DIV1_MASK GENMASK(24, 20)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_DIV0_SHIFT 15
|
||||
#define PRUSS_GPCFG_PRU_DIV0_MASK GENMASK(15, 19)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_GPO_MODE BIT(14)
|
||||
#define PRUSS_GPCFG_PRU_GPO_MODE_DIRECT 0
|
||||
#define PRUSS_GPCFG_PRU_GPO_MODE_SERIAL BIT(14)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_GPI_SB BIT(13)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_GPI_DIV1_SHIFT 8
|
||||
#define PRUSS_GPCFG_PRU_GPI_DIV1_MASK GENMASK(12, 8)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_GPI_DIV0_SHIFT 3
|
||||
#define PRUSS_GPCFG_PRU_GPI_DIV0_MASK GENMASK(7, 3)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_GPI_CLK_MODE_POSITIVE 0
|
||||
#define PRUSS_GPCFG_PRU_GPI_CLK_MODE_NEGATIVE BIT(2)
|
||||
#define PRUSS_GPCFG_PRU_GPI_CLK_MODE BIT(2)
|
||||
|
||||
#define PRUSS_GPCFG_PRU_GPI_MODE_MASK GENMASK(1, 0)
|
||||
#define PRUSS_GPCFG_PRU_GPI_MODE_SHIFT 0
|
||||
|
||||
#define PRUSS_GPCFG_PRU_MUX_SEL_SHIFT 26
|
||||
#define PRUSS_GPCFG_PRU_MUX_SEL_MASK GENMASK(29, 26)
|
||||
|
||||
/* PRUSS_MII_RT register bits */
|
||||
#define PRUSS_MII_RT_EVENT_EN BIT(0)
|
||||
|
||||
/* PRUSS_SPP register bits */
|
||||
#define PRUSS_SPP_PRU1_PAD_HP_EN BIT(0)
|
||||
#define PRUSS_SPP_XFER_SHIFT_EN BIT(1)
|
||||
#define PRUSS_SPP_XFR_BYTE_SHIFT_EN BIT(2)
|
||||
#define PRUSS_SPP_RTU_XFR_SHIFT_EN BIT(3)
|
||||
|
||||
/**
|
||||
* enum pruss_gp_mux_sel - PRUSS GPI/O Mux modes for the
|
||||
* PRUSS_GPCFG0/1 registers
|
||||
*
|
||||
* NOTE: The below defines are the most common values, but there
|
||||
* are some exceptions like on 66AK2G, where the RESERVED and MII2
|
||||
* values are interchanged. Also, this bit-field does not exist on
|
||||
* AM335x SoCs
|
||||
*/
|
||||
enum pruss_gp_mux_sel {
|
||||
PRUSS_GP_MUX_SEL_GP = 0,
|
||||
PRUSS_GP_MUX_SEL_ENDAT,
|
||||
PRUSS_GP_MUX_SEL_RESERVED,
|
||||
PRUSS_GP_MUX_SEL_SD,
|
||||
PRUSS_GP_MUX_SEL_MII2,
|
||||
PRUSS_GP_MUX_SEL_MAX,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pruss_gpi_mode - PRUSS GPI configuration modes, used
|
||||
* to program the PRUSS_GPCFG0/1 registers
|
||||
*/
|
||||
enum pruss_gpi_mode {
|
||||
PRUSS_GPI_MODE_DIRECT = 0,
|
||||
PRUSS_GPI_MODE_PARALLEL,
|
||||
PRUSS_GPI_MODE_28BIT_SHIFT,
|
||||
PRUSS_GPI_MODE_MII,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pruss_pru_id - PRU core identifiers
|
||||
*/
|
||||
enum pruss_pru_id {
|
||||
PRUSS_PRU0 = 0,
|
||||
PRUSS_PRU1,
|
||||
PRUSS_NUM_PRUS,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pru_ctable_idx - Configurable Constant table index identifiers
|
||||
*/
|
||||
enum pru_ctable_idx {
|
||||
PRU_C24 = 0,
|
||||
PRU_C25,
|
||||
PRU_C26,
|
||||
PRU_C27,
|
||||
PRU_C28,
|
||||
PRU_C29,
|
||||
PRU_C30,
|
||||
PRU_C31,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pruss_mem - PRUSS memory range identifiers
|
||||
*/
|
||||
enum pruss_mem {
|
||||
PRUSS_MEM_DRAM0 = 0,
|
||||
PRUSS_MEM_DRAM1,
|
||||
PRUSS_MEM_SHRD_RAM2,
|
||||
PRUSS_MEM_MAX,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pruss_mem_region - PRUSS memory region structure
|
||||
* @va: kernel virtual address of the PRUSS memory region
|
||||
* @pa: physical (bus) address of the PRUSS memory region
|
||||
* @size: size of the PRUSS memory region
|
||||
*/
|
||||
struct pruss_mem_region {
|
||||
void __iomem *va;
|
||||
phys_addr_t pa;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pruss - PRUSS parent structure
|
||||
* @dev: pruss device pointer
|
||||
* @cfg: regmap for config region
|
||||
* @mem_regions: data for each of the PRUSS memory regions
|
||||
* @mem_in_use: to indicate if memory resource is in use
|
||||
*/
|
||||
struct pruss {
|
||||
struct udevice *dev;
|
||||
struct regmap *cfg;
|
||||
struct pruss_mem_region mem_regions[PRUSS_MEM_MAX];
|
||||
struct pruss_mem_region *mem_in_use[PRUSS_MEM_MAX];
|
||||
};
|
||||
|
||||
int pruss_request_tm_region(struct udevice *dev, phys_addr_t *loc);
|
||||
int pruss_request_mem_region(struct udevice *dev, enum pruss_mem mem_id,
|
||||
struct pruss_mem_region *region);
|
||||
int pruss_release_mem_region(struct udevice *dev, struct pruss_mem_region *region);
|
||||
int pruss_cfg_update(struct udevice *dev, unsigned int reg,
|
||||
unsigned int mask, unsigned int val);
|
||||
|
||||
/**
|
||||
* pruss_cfg_gpimode() - set the GPI mode of the PRU
|
||||
* @dev: the pruss device
|
||||
* @pru_id: the rproc instance handle of the PRU
|
||||
* @mode: GPI mode to set
|
||||
*
|
||||
* Sets the GPI mode for a given PRU by programming the
|
||||
* corresponding PRUSS_CFG_GPCFGx register
|
||||
*
|
||||
* Returns 0 on success, or an error code otherwise
|
||||
*/
|
||||
static inline int pruss_cfg_gpimode(struct udevice *dev, enum pruss_pru_id id,
|
||||
enum pruss_gpi_mode mode)
|
||||
{
|
||||
if (id < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return pruss_cfg_update(dev, PRUSS_CFG_GPCFG(id),
|
||||
PRUSS_GPCFG_PRU_GPI_MODE_MASK,
|
||||
mode << PRUSS_GPCFG_PRU_GPI_MODE_SHIFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* pruss_cfg_miirt_enable() - Enable/disable MII RT Events
|
||||
* @dev: the pruss device
|
||||
* @enable: enable/disable
|
||||
*
|
||||
* Enable/disable the MII RT Events for the PRUSS.
|
||||
*/
|
||||
static inline int pruss_cfg_miirt_enable(struct udevice *dev, bool enable)
|
||||
{
|
||||
u32 set = enable ? PRUSS_MII_RT_EVENT_EN : 0;
|
||||
|
||||
return pruss_cfg_update(dev, PRUSS_CFG_MII_RT,
|
||||
PRUSS_MII_RT_EVENT_EN, set);
|
||||
}
|
||||
|
||||
/**
|
||||
* pruss_cfg_xfr_enable() - Enable/disable XIN XOUT shift functionality
|
||||
* @dev: the pruss device
|
||||
* @enable: enable/disable
|
||||
*/
|
||||
static inline int pruss_cfg_xfr_enable(struct udevice *dev, bool enable)
|
||||
{
|
||||
u32 set = enable ? PRUSS_SPP_XFER_SHIFT_EN : 0;
|
||||
|
||||
return pruss_cfg_update(dev, PRUSS_CFG_SPP,
|
||||
PRUSS_SPP_XFER_SHIFT_EN, set);
|
||||
}
|
||||
|
||||
/**
|
||||
* pruss_cfg_set_gpmux() - set the GPMUX value for a PRU device
|
||||
* @pruss: pruss device
|
||||
* @pru_id: PRU identifier (0-1)
|
||||
* @mux: new mux value for PRU
|
||||
*/
|
||||
static inline int pruss_cfg_set_gpmux(struct udevice *dev,
|
||||
enum pruss_pru_id id, u8 mux)
|
||||
{
|
||||
if (mux >= PRUSS_GP_MUX_SEL_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
return pruss_cfg_update(dev, PRUSS_CFG_GPCFG(id),
|
||||
PRUSS_GPCFG_PRU_MUX_SEL_MASK,
|
||||
(u32)mux << PRUSS_GPCFG_PRU_MUX_SEL_SHIFT);
|
||||
}
|
||||
|
||||
#endif /* __TI_PRUSS_H */
|
||||
@@ -2,6 +2,7 @@
|
||||
#define TPS659412 0x1
|
||||
#define TPS659413 0x2
|
||||
#define TPS659414 0x3
|
||||
#define LP876441 0x4
|
||||
|
||||
/* I2C device address for pmic tps65941 */
|
||||
#define TPS65941_I2C_ADDR (0x12 >> 1)
|
||||
|
||||
Reference in New Issue
Block a user