OSDN Git Service

drm/amdgpu/discovery: add ip discovery initial support
authorXiaojie Yuan <xiaojie.yuan@amd.com>
Thu, 20 Jun 2019 15:18:50 +0000 (10:18 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:58:21 +0000 (18:58 -0500)
commitf39f5bb1c9d68d557ff1539fea7adfe7c4d4ed7a
tree34a5a2b39d836847181e60ae31db87a11ca3a95e
parent80f8fb9178eda5a16b5ff8e2b2e8304f0a06f5f4
drm/amdgpu/discovery: add ip discovery initial support

The IP discovery table lists is populated by the psp at power on
and includes all of the hw details on the board:
- List of IPs and MMIO offsets
- IP harvest details
- IP configuration details

v2: prefix struct and function names with 'amdgpu'
v3: read table binary from vram using mmMM_INDEX and mmMM_DATA
    update TABLE_BINARY_MAX_SIZE to 64kb (1 TMR)
    add 'instance_number' field per ip info
    consider endianness and replace uint8/16/32_t with u8/16/32
    initialize register base addresses
    initialize adev->gfx.config and adev->gfx.cu_info to replace gpu info fw
    get major and minor version using a single api
    don't expose internal data structures in amdgpu_discovery.h
v4: RCC_CONFIG_MEMSIZE is in MB units
    hold mmio_idx_lock while reading ip discovery binary
v5: pick out discovery.h as a cross-OS header
    do structure pointer cast directly
    consider endianness while using the member of structure
    convert base addresses to dword

at boot up, PSP BL copies ip discovery binary from VBIOS(SPIROM) image to the
top of the frame buffer (just below the reserved regions for PSP & SMU).

ip discovery data table includes the collection of each ip's identification
number, base addresses, version number, and harvest setting placeholder.

gc data table includes gfx info structure.

Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/Makefile
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c [new file with mode: 0644]
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h [new file with mode: 0644]
drivers/gpu/drm/amd/include/discovery.h [new file with mode: 0644]