Suman Anna | 27fa412 | 2022-05-25 13:38:42 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * K3: AM62 SoC definitions, structures etc. |
| 4 | * |
| 5 | * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/ |
| 6 | * Suman Anna <s-anna@ti.com> |
| 7 | */ |
| 8 | |
| 9 | #ifndef __ASM_ARCH_AM62_HARDWARE_H |
| 10 | #define __ASM_ARCH_AM62_HARDWARE_H |
| 11 | |
| 12 | #include <config.h> |
| 13 | #ifndef __ASSEMBLY__ |
| 14 | #include <linux/bitops.h> |
| 15 | #endif |
| 16 | |
| 17 | #define PADCFG_MMR0_BASE 0x04080000 |
| 18 | #define PADCFG_MMR1_BASE 0x000f0000 |
| 19 | #define CTRL_MMR0_BASE 0x00100000 |
| 20 | #define MCU_CTRL_MMR0_BASE 0x04500000 |
| 21 | #define WKUP_CTRL_MMR0_BASE 0x43000000 |
| 22 | |
| 23 | #define CTRLMMR_MAIN_DEVSTAT (WKUP_CTRL_MMR0_BASE + 0x30) |
| 24 | #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_MASK GENMASK(6, 3) |
| 25 | #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_SHIFT 3 |
| 26 | #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_CFG_MASK GENMASK(9, 7) |
| 27 | #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_CFG_SHIFT 7 |
| 28 | #define MAIN_DEVSTAT_BACKUP_BOOTMODE_MASK GENMASK(12, 10) |
| 29 | #define MAIN_DEVSTAT_BACKUP_BOOTMODE_SHIFT 10 |
| 30 | #define MAIN_DEVSTAT_BACKUP_BOOTMODE_CFG_MASK BIT(13) |
| 31 | #define MAIN_DEVSTAT_BACKUP_BOOTMODE_CFG_SHIFT 13 |
Julien Panis | 01b00d4 | 2022-07-01 14:30:11 +0200 | [diff] [blame] | 32 | #define RST_CTRL_ESM_ERROR_RST_EN_Z_MASK (~BIT(17)) |
Suman Anna | 27fa412 | 2022-05-25 13:38:42 +0530 | [diff] [blame] | 33 | |
| 34 | /* Primary Bootmode MMC Config macros */ |
| 35 | #define MAIN_DEVSTAT_PRIMARY_MMC_PORT_MASK 0x4 |
| 36 | #define MAIN_DEVSTAT_PRIMARY_MMC_PORT_SHIFT 2 |
| 37 | #define MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_MASK 0x1 |
| 38 | #define MAIN_DEVSTAT_PRIMARY_MMC_FS_RAW_SHIFT 0 |
| 39 | |
| 40 | /* Primary Bootmode USB Config macros */ |
| 41 | #define MAIN_DEVSTAT_PRIMARY_USB_MODE_SHIFT 1 |
| 42 | #define MAIN_DEVSTAT_PRIMARY_USB_MODE_MASK 0x02 |
| 43 | |
| 44 | /* Backup Bootmode USB Config macros */ |
| 45 | #define MAIN_DEVSTAT_BACKUP_USB_MODE_MASK 0x01 |
| 46 | |
Suman Anna | 27fa412 | 2022-05-25 13:38:42 +0530 | [diff] [blame] | 47 | #define MCU_CTRL_LFXOSC_CTRL (MCU_CTRL_MMR0_BASE + 0x8038) |
| 48 | #define MCU_CTRL_LFXOSC_TRIM (MCU_CTRL_MMR0_BASE + 0x803c) |
| 49 | #define MCU_CTRL_LFXOSC_32K_DISABLE_VAL BIT(7) |
| 50 | |
| 51 | #define MCU_CTRL_DEVICE_CLKOUT_32K_CTRL (MCU_CTRL_MMR0_BASE + 0x8058) |
| 52 | #define MCU_CTRL_DEVICE_CLKOUT_LFOSC_SELECT_VAL (0x3) |
| 53 | |
Julien Panis | 01b00d4 | 2022-07-01 14:30:11 +0200 | [diff] [blame] | 54 | #define CTRLMMR_MCU_RST_CTRL (MCU_CTRL_MMR0_BASE + 0x18170) |
| 55 | |
Bryan Brattlof | 270537c | 2022-11-22 13:28:11 -0600 | [diff] [blame] | 56 | #define ROM_EXTENDED_BOOT_DATA_INFO 0x43c3f1e0 |
Suman Anna | 27fa412 | 2022-05-25 13:38:42 +0530 | [diff] [blame] | 57 | |
| 58 | /* Use Last 2K as Scratch pad */ |
| 59 | #define TI_SRAM_SCRATCH_BOARD_EEPROM_START 0x70000000 |
| 60 | |
| 61 | #endif /* __ASM_ARCH_AM62_HARDWARE_H */ |