diff options
| author | Evan Lojewski <github@meklort.com> | 2021-06-14 18:53:01 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-14 18:53:01 -0600 |
| commit | a22057abb0394d86c382c488ac9b4fb7f52618df (patch) | |
| tree | bee338fd27972083a389fb889719fb4ac6065fe6 /include | |
| parent | c99d0b237253fa1a8d7bd0e2db5843ae49949f5f (diff) | |
| download | bcm5719-ortega-a22057abb0394d86c382c488ac9b4fb7f52618df.tar.gz bcm5719-ortega-a22057abb0394d86c382c488ac9b4fb7f52618df.zip | |
ape: Handle host driver events to improve FreeBSD compatibility. (#222)
This silences the following FreeBSD message:
bge0: APE event 0x00020510 send timed out
Diffstat (limited to 'include')
| -rw-r--r-- | include/APE_SHM.h | 44 | ||||
| -rw-r--r-- | include/APE_SHM1.h | 3 | ||||
| -rw-r--r-- | include/APE_SHM2.h | 3 | ||||
| -rw-r--r-- | include/APE_SHM3.h | 3 | ||||
| -rw-r--r-- | include/bcm5719_SHM.h | 44 |
5 files changed, 86 insertions, 11 deletions
diff --git a/include/APE_SHM.h b/include/APE_SHM.h index 46881fb..0024f21 100644 --- a/include/APE_SHM.h +++ b/include/APE_SHM.h @@ -10,7 +10,7 @@ /// //////////////////////////////////////////////////////////////////////////////// /// -/// @copyright Copyright (c) 2020, Evan Lojewski +/// @copyright Copyright (c) 2021, Evan Lojewski /// @cond /// /// All rights reserved. @@ -457,6 +457,31 @@ typedef register_container RegSHM4028_t { #endif /* CXX_SIMULATOR */ } RegSHM4028_t; +#define REG_SHM_DRIVER_BUFFER ((volatile APE_SHM_H_uint32_t*)0x60220030) /* Communication channel between the host driver and the APE. */ +/** @brief Register definition for @ref SHM_t.DriverBuffer. */ +typedef register_container RegSHMDriverBuffer_t { + /** @brief 32bit direct register access. */ + APE_SHM_H_uint32_t r32; +#ifdef CXX_SIMULATOR + /** @brief Register name for use with the simulator. */ + const char* getName(void) { return "DriverBuffer"; } + + /** @brief Print register value. */ + void print(void) { r32.print(); } + + RegSHMDriverBuffer_t() + { + /** @brief constructor for @ref SHM_t.DriverBuffer. */ + r32.setName("DriverBuffer"); + } + RegSHMDriverBuffer_t& operator=(const RegSHMDriverBuffer_t& other) + { + r32 = other.r32; + return *this; + } +#endif /* CXX_SIMULATOR */ +} RegSHMDriverBuffer_t; + #define REG_SHM_LOADER_COMMAND ((volatile APE_SHM_H_uint32_t*)0x60220038) /* Command sent when using the the APE loader. Zero once handled. */ #define SHM_LOADER_COMMAND_COMMAND_SHIFT 0u #define SHM_LOADER_COMMAND_COMMAND_MASK 0xffffffffu @@ -1590,7 +1615,10 @@ typedef struct SHM_t { RegSHM4028_t _4028; /** @brief Reserved bytes to pad out data structure. */ - APE_SHM_H_uint32_t reserved_44[3]; + APE_SHM_H_uint32_t reserved_44[1]; + + /** @brief Communication channel between the host driver and the APE. */ + RegSHMDriverBuffer_t DriverBuffer[2]; /** @brief Command sent when using the the APE loader. Zero once handled. */ RegSHMLoaderCommand_t LoaderCommand; @@ -1736,10 +1764,14 @@ typedef struct SHM_t { SegMessageBufferLength.r32.setComponentOffset(0x20); _4024.r32.setComponentOffset(0x24); _4028.r32.setComponentOffset(0x28); - for(int i = 0; i < 3; i++) + for(int i = 0; i < 1; i++) { reserved_44[i].setComponentOffset(0x2c + (i * 4)); } + for(int i = 0; i < 2; i++) + { + DriverBuffer[i].r32.setComponentOffset(0x30 + (i * 4)); + } LoaderCommand.r32.setComponentOffset(0x38); LoaderArg0.r32.setComponentOffset(0x3c); LoaderArg1.r32.setComponentOffset(0x40); @@ -1821,10 +1853,14 @@ typedef struct SHM_t { SegMessageBufferLength.print(); _4024.print(); _4028.print(); - for(int i = 0; i < 3; i++) + for(int i = 0; i < 1; i++) { reserved_44[i].print(); } + for(int i = 0; i < 2; i++) + { + DriverBuffer[i].print(); + } LoaderCommand.print(); LoaderArg0.print(); LoaderArg1.print(); diff --git a/include/APE_SHM1.h b/include/APE_SHM1.h index 05bbd03..b3e55ee 100644 --- a/include/APE_SHM1.h +++ b/include/APE_SHM1.h @@ -10,7 +10,7 @@ /// //////////////////////////////////////////////////////////////////////////////// /// -/// @copyright Copyright (c) 2020, Evan Lojewski +/// @copyright Copyright (c) 2021, Evan Lojewski /// @cond /// /// All rights reserved. @@ -92,6 +92,7 @@ typedef uint32_t APE_SHM1_H_uint32_t; #define REG_SHM1_SEG_MESSAGE_BUFFER_LENGTH ((volatile APE_SHM1_H_uint32_t*)0x60221020) /* Specifies the size of the scratchpad area in bytes. */ #define REG_SHM1_4024 ((volatile APE_SHM1_H_uint32_t*)0x60221024) /* Unknown. Bootcode related. */ #define REG_SHM1_4028 ((volatile APE_SHM1_H_uint32_t*)0x60221028) /* Unknown. Bootcode related. */ +#define REG_SHM1_DRIVER_BUFFER ((volatile APE_SHM1_H_uint32_t*)0x60221030) /* Communication channel between the host driver and the APE. */ #define REG_SHM1_LOADER_COMMAND ((volatile APE_SHM1_H_uint32_t*)0x60221038) /* Command sent when using the the APE loader. Zero once handled. */ #define REG_SHM1_LOADER_ARG0 ((volatile APE_SHM1_H_uint32_t*)0x6022103c) /* Argument 0 for the APE loader. */ #define REG_SHM1_LOADER_ARG1 ((volatile APE_SHM1_H_uint32_t*)0x60221040) /* Argument 1 for the APE loader. */ diff --git a/include/APE_SHM2.h b/include/APE_SHM2.h index 647e554..cab9c76 100644 --- a/include/APE_SHM2.h +++ b/include/APE_SHM2.h @@ -10,7 +10,7 @@ /// //////////////////////////////////////////////////////////////////////////////// /// -/// @copyright Copyright (c) 2020, Evan Lojewski +/// @copyright Copyright (c) 2021, Evan Lojewski /// @cond /// /// All rights reserved. @@ -92,6 +92,7 @@ typedef uint32_t APE_SHM2_H_uint32_t; #define REG_SHM2_SEG_MESSAGE_BUFFER_LENGTH ((volatile APE_SHM2_H_uint32_t*)0x60222020) /* Specifies the size of the scratchpad area in bytes. */ #define REG_SHM2_4024 ((volatile APE_SHM2_H_uint32_t*)0x60222024) /* Unknown. Bootcode related. */ #define REG_SHM2_4028 ((volatile APE_SHM2_H_uint32_t*)0x60222028) /* Unknown. Bootcode related. */ +#define REG_SHM2_DRIVER_BUFFER ((volatile APE_SHM2_H_uint32_t*)0x60222030) /* Communication channel between the host driver and the APE. */ #define REG_SHM2_LOADER_COMMAND ((volatile APE_SHM2_H_uint32_t*)0x60222038) /* Command sent when using the the APE loader. Zero once handled. */ #define REG_SHM2_LOADER_ARG0 ((volatile APE_SHM2_H_uint32_t*)0x6022203c) /* Argument 0 for the APE loader. */ #define REG_SHM2_LOADER_ARG1 ((volatile APE_SHM2_H_uint32_t*)0x60222040) /* Argument 1 for the APE loader. */ diff --git a/include/APE_SHM3.h b/include/APE_SHM3.h index 76b4729..3170c83 100644 --- a/include/APE_SHM3.h +++ b/include/APE_SHM3.h @@ -10,7 +10,7 @@ /// //////////////////////////////////////////////////////////////////////////////// /// -/// @copyright Copyright (c) 2020, Evan Lojewski +/// @copyright Copyright (c) 2021, Evan Lojewski /// @cond /// /// All rights reserved. @@ -92,6 +92,7 @@ typedef uint32_t APE_SHM3_H_uint32_t; #define REG_SHM3_SEG_MESSAGE_BUFFER_LENGTH ((volatile APE_SHM3_H_uint32_t*)0x60223020) /* Specifies the size of the scratchpad area in bytes. */ #define REG_SHM3_4024 ((volatile APE_SHM3_H_uint32_t*)0x60223024) /* Unknown. Bootcode related. */ #define REG_SHM3_4028 ((volatile APE_SHM3_H_uint32_t*)0x60223028) /* Unknown. Bootcode related. */ +#define REG_SHM3_DRIVER_BUFFER ((volatile APE_SHM3_H_uint32_t*)0x60223030) /* Communication channel between the host driver and the APE. */ #define REG_SHM3_LOADER_COMMAND ((volatile APE_SHM3_H_uint32_t*)0x60223038) /* Command sent when using the the APE loader. Zero once handled. */ #define REG_SHM3_LOADER_ARG0 ((volatile APE_SHM3_H_uint32_t*)0x6022303c) /* Argument 0 for the APE loader. */ #define REG_SHM3_LOADER_ARG1 ((volatile APE_SHM3_H_uint32_t*)0x60223040) /* Argument 1 for the APE loader. */ diff --git a/include/bcm5719_SHM.h b/include/bcm5719_SHM.h index b775fae..4ceceb9 100644 --- a/include/bcm5719_SHM.h +++ b/include/bcm5719_SHM.h @@ -10,7 +10,7 @@ /// //////////////////////////////////////////////////////////////////////////////// /// -/// @copyright Copyright (c) 2020, Evan Lojewski +/// @copyright Copyright (c) 2021, Evan Lojewski /// @cond /// /// All rights reserved. @@ -457,6 +457,31 @@ typedef register_container RegSHM4028_t { #endif /* CXX_SIMULATOR */ } RegSHM4028_t; +#define REG_SHM_DRIVER_BUFFER ((volatile BCM5719_SHM_H_uint32_t*)0xc0014030) /* Communication channel between the host driver and the APE. */ +/** @brief Register definition for @ref SHM_t.DriverBuffer. */ +typedef register_container RegSHMDriverBuffer_t { + /** @brief 32bit direct register access. */ + BCM5719_SHM_H_uint32_t r32; +#ifdef CXX_SIMULATOR + /** @brief Register name for use with the simulator. */ + const char* getName(void) { return "DriverBuffer"; } + + /** @brief Print register value. */ + void print(void) { r32.print(); } + + RegSHMDriverBuffer_t() + { + /** @brief constructor for @ref SHM_t.DriverBuffer. */ + r32.setName("DriverBuffer"); + } + RegSHMDriverBuffer_t& operator=(const RegSHMDriverBuffer_t& other) + { + r32 = other.r32; + return *this; + } +#endif /* CXX_SIMULATOR */ +} RegSHMDriverBuffer_t; + #define REG_SHM_LOADER_COMMAND ((volatile BCM5719_SHM_H_uint32_t*)0xc0014038) /* Command sent when using the the APE loader. Zero once handled. */ #define SHM_LOADER_COMMAND_COMMAND_SHIFT 0u #define SHM_LOADER_COMMAND_COMMAND_MASK 0xffffffffu @@ -1590,7 +1615,10 @@ typedef struct SHM_t { RegSHM4028_t _4028; /** @brief Reserved bytes to pad out data structure. */ - BCM5719_SHM_H_uint32_t reserved_44[3]; + BCM5719_SHM_H_uint32_t reserved_44[1]; + + /** @brief Communication channel between the host driver and the APE. */ + RegSHMDriverBuffer_t DriverBuffer[2]; /** @brief Command sent when using the the APE loader. Zero once handled. */ RegSHMLoaderCommand_t LoaderCommand; @@ -1736,10 +1764,14 @@ typedef struct SHM_t { SegMessageBufferLength.r32.setComponentOffset(0x20); _4024.r32.setComponentOffset(0x24); _4028.r32.setComponentOffset(0x28); - for(int i = 0; i < 3; i++) + for(int i = 0; i < 1; i++) { reserved_44[i].setComponentOffset(0x2c + (i * 4)); } + for(int i = 0; i < 2; i++) + { + DriverBuffer[i].r32.setComponentOffset(0x30 + (i * 4)); + } LoaderCommand.r32.setComponentOffset(0x38); LoaderArg0.r32.setComponentOffset(0x3c); LoaderArg1.r32.setComponentOffset(0x40); @@ -1821,10 +1853,14 @@ typedef struct SHM_t { SegMessageBufferLength.print(); _4024.print(); _4028.print(); - for(int i = 0; i < 3; i++) + for(int i = 0; i < 1; i++) { reserved_44[i].print(); } + for(int i = 0; i < 2; i++) + { + DriverBuffer[i].print(); + } LoaderCommand.print(); LoaderArg0.print(); LoaderArg1.print(); |

