u-boot/board/gateworks/venice
Tom Rini 208fc7a9f9 Merge patch series "provide names for emmc hardware partitions"
Tim Harvey <tharvey@gateworks.com> says:

Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC
specification described as:
 Boot Area Partition 1
 Boot Area Partition 2
 RPMB Partition
 General Purpose Partition 1
 General Purpose Partition 2
 General Purpose Partition 3
 General Purpose Partition 4
 User Data Area

These are referenced by fields in the PARTITION_CONFIG register
(Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6: BOOT_ACK
  0x0: No boot acknowledge sent (default
  0x1: Boot acknowledge sent during boot operation Bit
bit 5:3: BOOT_PARTITION_ENABLE
  0x0: Device not boot enabled (default)
  0x1: Boot Area partition 1 enabled for boot
  0x2: Boot Area partition 2 enabled for boot
  0x3-0x6: Reserved
  0x7: User area enabled for boot
bit 2:0 PARTITION_ACCESS
  0x0: No access to boot partition (default)
  0x1: Boot Area partition 1
  0x2: Boot Area partition 2
  0x3: Replay Protected Memory Block (RPMB)
  0x4: Access to General Purpose partition 1
  0x5: Access to General Purpose partition 2
  0x6: Access to General Purpose partition 3
  0x7: Access to General Purpose partition 4

Note that setting PARTITION_ACCESS to 0x0 results in selecting the User
Data Area partition.

You can see above that the two fields BOOT_PARTITION_ENABLE and
PARTITION_ACCESS do not use the same enumerated values.

U-Boot uses a set of macros to access fields of the PARTITION_CONFIG
register:
EXT_CSD_BOOT_ACK_ENABLE                 (1 << 6)
EXT_CSD_BOOT_PARTITION_ENABLE           (1 << 3)
EXT_CSD_PARTITION_ACCESS_ENABLE         (1 << 0)
EXT_CSD_PARTITION_ACCESS_DISABLE        (0 << 0)

EXT_CSD_BOOT_ACK(x)             (x << 6)
EXT_CSD_BOOT_PART_NUM(x)        (x << 3)
EXT_CSD_PARTITION_ACCESS(x)     (x << 0)

EXT_CSD_EXTRACT_BOOT_ACK(x) (((x) >> 6) & 0x1)
EXT_CSD_EXTRACT_BOOT_PART(x) (((x) >> 3) & 0x7)
EXT_CSD_EXTRACT_PARTITION_ACCESS(x) ((x) & 0x7)

There are various places in U-Boot where the BOOT_PARTITION_ENABLE field
is accessed via EXT_CSD_EXTRACT_PARTITION_ACCESS and converted to a
hardware partition consistent with the definition of the
PARTITION_ACCESS field used by the various mmc_switch incarnations.

To add some sanity to the distinction between BOOT_PARTITION_ENABLE
(used to specify the active device on power-cycle) and PARTITION_ACCESS
(used to switch between hardware partitions) create two enumerated types
and use them wherever struct mmc * part_config is used or the above
macros are used.

Additionally provide arrays of the field names and allow those to be
used in the 'mmc partconf' command and in board support files.

The first patch adds enumerated types and makes use of them which
represents no compiled code change.

The 2nd patch adds the array of names and uses them in the 'mmc
partconf' command.

The 3rd patch uses the array of hardware partition names in a board
support file to show what emmc hardware partition U-Boot is being loaded
from.
2024-09-05 12:13:24 -06:00
..
eeprom.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
eeprom.h board: gateworks: venice: rename eeprom_init 2022-10-20 17:35:51 +02:00
imximage-8mm-lpddr4.cfg imx: Don't define __ASSEMBLY__ in source files 2022-02-08 23:07:58 -05:00
imximage-8mn-lpddr4.cfg board: gateworks: venice: add imx8mn-gw7902 support 2022-02-19 14:46:54 +01:00
imximage-8mp-lpddr4.cfg board: gateworks: venice: add imx8mp-venice-gw740x support 2022-04-21 12:44:24 +02:00
Kconfig board: gateworks: venice: add imx8mp-venice-gw740x support 2022-04-21 12:44:24 +02:00
lpddr4_timing.h board: gateworks: venice: add imx8mp-gw7905-2x support 2023-07-11 14:40:05 +02:00
lpddr4_timing_imx8mm.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
lpddr4_timing_imx8mn.c board: gateworks: venice: add imx8mn-gw7902 support 2022-02-19 14:46:54 +01:00
lpddr4_timing_imx8mp.c imx8mp-venice: update DRAM config for 2000MHz 2023-12-14 15:34:12 -03:00
MAINTAINERS board: gateworks: venice: move README to RST 2023-02-19 21:15:15 +01:00
Makefile board: gateworks: venice: add imx8mp-venice-gw740x support 2022-04-21 12:44:24 +02:00
spl.c Merge patch series "provide names for emmc hardware partitions" 2024-09-05 12:13:24 -06:00
venice.c Merge patch series "provide names for emmc hardware partitions" 2024-09-05 12:13:24 -06:00
venice.env board: gateworks: venice: dynamically update the update_firmware script 2023-07-11 14:40:03 +02:00