mirror of https://github.com/akuker/RASCSI.git
dynamic handling of bpi board types
This commit is contained in:
parent
530bfaff53
commit
7ad9ba510a
|
@ -30,13 +30,13 @@
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <iomanip>
|
||||
|
||||
#include "hal/gpiobus.h"
|
||||
#include "hal/gpiobus_allwinner.h"
|
||||
|
@ -155,8 +155,10 @@ bool GPIOBUS_Allwinner::Init(mode_e mode, board_type::rascsi_board_type_e rascsi
|
|||
{
|
||||
GPIOBUS::Init(mode, rascsi_type);
|
||||
SysTimer::Init();
|
||||
// Hard-coding to banana pi m2 plus for now
|
||||
phys_to_gpio_map = make_shared<Banana_Pi_Gpio_Mapping>(banana_pi_m2p_map);
|
||||
|
||||
sbc_version = SBC_Version::GetSbcVersion();
|
||||
phys_to_gpio_map = BPI_GPIO::GetBpiGpioMapping(sbc_version);
|
||||
|
||||
for (auto const &pair : phys_to_gpio_map->phys_to_gpio_map) {
|
||||
LOGDEBUG("{ %d, : %d}", (int)pair.first, pair.second)
|
||||
|
||||
|
@ -321,7 +323,6 @@ void GPIOBUS_Allwinner::Cleanup()
|
|||
LOGWARN("%s NOT IMPLEMENTED", __PRETTY_FUNCTION__)
|
||||
}
|
||||
|
||||
|
||||
// bool GPIOBUSS_Allwinner::SetupSelEvent(){
|
||||
|
||||
// // GPIO chip open
|
||||
|
@ -371,7 +372,6 @@ void GPIOBUS_Allwinner::Cleanup()
|
|||
// epoll_ctl(epfd, EPOLL_CTL_ADD, selevreq.fd, &ev);
|
||||
// }
|
||||
|
||||
|
||||
uint8_t GPIOBUS_Allwinner::GetDAT()
|
||||
{
|
||||
LOGWARN("%s NOT IMPLEMENTED", __PRETTY_FUNCTION__)
|
||||
|
@ -379,9 +379,9 @@ uint8_t GPIOBUS_Allwinner::GetDAT()
|
|||
// GetSignal(PIN_DT1),GetSignal(PIN_DT2),GetSignal(PIN_DT3),GetSignal(PIN_DT4),GetSignal(PIN_DT5),GetSignal(PIN_DT6),GetSignal(PIN_DT7),GetSignal(PIN_DP));
|
||||
// TODO: This is crazy inefficient...
|
||||
uint8_t data = ((GetSignal(board->pin_dt0) ? 0x01 : 0x00) << 0) | ((GetSignal(board->pin_dt1) ? 0x01 : 0x00) << 1) |
|
||||
((GetSignal(board->pin_dt2) ? 0x01 : 0x00) << 2) | ((GetSignal(board->pin_dt3) ? 0x01 : 0x00) << 3) |
|
||||
((GetSignal(board->pin_dt4) ? 0x01 : 0x00) << 0) | ((GetSignal(board->pin_dt5) ? 0x01 : 0x00) << 5) |
|
||||
((GetSignal(board->pin_dt6) ? 0x01 : 0x00) << 6) | ((GetSignal(board->pin_dt7) ? 0x01 : 0x00) << 7);
|
||||
((GetSignal(board->pin_dt2) ? 0x01 : 0x00) << 2) | ((GetSignal(board->pin_dt3) ? 0x01 : 0x00) << 3) |
|
||||
((GetSignal(board->pin_dt4) ? 0x01 : 0x00) << 0) | ((GetSignal(board->pin_dt5) ? 0x01 : 0x00) << 5) |
|
||||
((GetSignal(board->pin_dt6) ? 0x01 : 0x00) << 6) | ((GetSignal(board->pin_dt7) ? 0x01 : 0x00) << 7);
|
||||
|
||||
return (uint8_t)data;
|
||||
// return 0;
|
||||
|
@ -443,7 +443,7 @@ void GPIOBUS_Allwinner::SetMode(board_type::pi_physical_pin_e pin, board_type::g
|
|||
bool GPIOBUS_Allwinner::GetSignal(board_type::pi_physical_pin_e pin) const
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
int gpio_num = phys_to_gpio_map->phys_to_gpio_map.at(pin);
|
||||
int gpio_num = phys_to_gpio_map->phys_to_gpio_map.at(pin);
|
||||
// int sunxi_gpio_state = sunxi_input_gpio(gpio_num);
|
||||
|
||||
uint32_t regval = 0;
|
||||
|
@ -464,14 +464,6 @@ bool GPIOBUS_Allwinner::GetSignal(board_type::pi_physical_pin_e pin) const
|
|||
|
||||
int sunxi_gpio_state = regval;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
LOGDEBUG("%s GPIO %d is set to %d", __PRETTY_FUNCTION__, gpio_num, sunxi_gpio_state);
|
||||
|
||||
if (sunxi_gpio_state == HIGH) {
|
||||
|
@ -588,7 +580,7 @@ void GPIOBUS_Allwinner::PullConfig(board_type::pi_physical_pin_e pin, board_type
|
|||
#else
|
||||
|
||||
// Note: this will throw an exception if an invalid pin is specified
|
||||
int gpio_num = phys_to_gpio_map->phys_to_gpio_map.at(pin);
|
||||
int gpio_num = phys_to_gpio_map->phys_to_gpio_map.at(pin);
|
||||
int pull_up_down_state = 0;
|
||||
|
||||
switch (mode) {
|
||||
|
@ -652,8 +644,8 @@ void GPIOBUS_Allwinner::DrvConfig(uint32_t drive)
|
|||
uint32_t GPIOBUS_Allwinner::Acquire()
|
||||
{
|
||||
// (void)sunxi_capture_all_gpio();
|
||||
// uint32_t GPIOBUS_Allwinner::sunxi_capture_all_gpio()
|
||||
// {
|
||||
// uint32_t GPIOBUS_Allwinner::sunxi_capture_all_gpio()
|
||||
// {
|
||||
GPIO_FUNCTION_TRACE
|
||||
|
||||
uint32_t value = 0;
|
||||
|
@ -671,9 +663,6 @@ uint32_t GPIOBUS_Allwinner::Acquire()
|
|||
}
|
||||
// return value;
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -779,10 +768,10 @@ void GPIOBUS_Allwinner::sunxi_setup_gpio(int gpio, int direction, int pud)
|
|||
(void)pud;
|
||||
return;
|
||||
#else
|
||||
uint32_t regval = 0;
|
||||
int bank = GPIO_BANK(gpio); // gpio >> 5
|
||||
int index = GPIO_CFG_INDEX(gpio); // (gpio & 0x1F) >> 3
|
||||
int offset = GPIO_CFG_OFFSET(gpio); // ((gpio & 0x1F) & 0x7) << 2
|
||||
uint32_t regval = 0;
|
||||
int bank = GPIO_BANK(gpio); // gpio >> 5
|
||||
int index = GPIO_CFG_INDEX(gpio); // (gpio & 0x1F) >> 3
|
||||
int offset = GPIO_CFG_OFFSET(gpio); // ((gpio & 0x1F) & 0x7) << 2
|
||||
LOGDEBUG("%s gpio(%d) bank(%d) index(%d) offset(%d)", __PRETTY_FUNCTION__, gpio, bank, index, offset)
|
||||
|
||||
sunxi_gpio_t *pio = &((sunxi_gpio_reg_t *)pio_map)->gpio_bank[bank];
|
||||
|
@ -964,7 +953,6 @@ int GPIOBUS_Allwinner::bpi_piGpioLayout(void)
|
|||
// return -1;
|
||||
// }
|
||||
|
||||
|
||||
void GPIOBUS_Allwinner::set_pullupdn(int gpio, int pud)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
|
@ -991,7 +979,6 @@ void GPIOBUS_Allwinner::set_pullupdn(int gpio, int pud)
|
|||
*(gpio_map + clk_offset) = 0;
|
||||
}
|
||||
|
||||
|
||||
void GPIOBUS_Allwinner::short_wait(void)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include "config.h"
|
||||
#include "hal/gpiobus.h"
|
||||
#include "hal/board_type.h"
|
||||
#include "hal/gpiobus.h"
|
||||
#include "hal/pi_defs/bpi-gpio.h"
|
||||
#include "hal/sbc_version.h"
|
||||
#include "log.h"
|
||||
#include "scsi.h"
|
||||
#include <map>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -28,11 +29,11 @@ class GPIOBUS_Allwinner : public GPIOBUS
|
|||
{
|
||||
public:
|
||||
// Basic Functions
|
||||
GPIOBUS_Allwinner() = default;
|
||||
GPIOBUS_Allwinner() = default;
|
||||
~GPIOBUS_Allwinner() override = default;
|
||||
// Destructor
|
||||
bool Init(mode_e mode = mode_e::TARGET, board_type::rascsi_board_type_e
|
||||
rascsi_type = board_type::rascsi_board_type_e::BOARD_TYPE_FULLSPEC) override;
|
||||
bool Init(mode_e mode = mode_e::TARGET, board_type::rascsi_board_type_e rascsi_type =
|
||||
board_type::rascsi_board_type_e::BOARD_TYPE_FULLSPEC) override;
|
||||
|
||||
void Cleanup() override;
|
||||
|
||||
|
@ -48,7 +49,7 @@ class GPIOBUS_Allwinner : public GPIOBUS
|
|||
void SetDAT(uint8_t dat) override;
|
||||
// Set DAT signal
|
||||
// TODO: Restore these back to protected
|
||||
// protected:
|
||||
// protected:
|
||||
// SCSI I/O signal control
|
||||
void MakeTable() override;
|
||||
// Create work data
|
||||
|
@ -57,7 +58,7 @@ class GPIOBUS_Allwinner : public GPIOBUS
|
|||
void SetMode(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) override;
|
||||
// Set SCSI I/O mode
|
||||
bool GetSignal(board_type::pi_physical_pin_e pin) const override;
|
||||
|
||||
|
||||
// Get SCSI input signal value
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set SCSI output signal value
|
||||
|
@ -90,14 +91,10 @@ class GPIOBUS_Allwinner : public GPIOBUS
|
|||
|
||||
volatile uint32_t *pads = nullptr; // PADS register
|
||||
|
||||
volatile uint32_t *gpio_map;
|
||||
volatile uint32_t *gpio_map;
|
||||
|
||||
|
||||
|
||||
int bpi_piGpioLayout (void);
|
||||
// int bpi_get_rpi_info(rpi_info *info);
|
||||
|
||||
|
||||
int bpi_piGpioLayout(void);
|
||||
// int bpi_get_rpi_info(rpi_info *info);
|
||||
|
||||
#if !defined(__x86_64__) && !defined(__X86__)
|
||||
volatile uint32_t *level = nullptr; // GPIO input level
|
||||
|
@ -141,10 +138,8 @@ int bpi_piGpioLayout (void);
|
|||
array<uint32_t, 256> tblDatSet = {}; // Table setting table
|
||||
#endif
|
||||
|
||||
|
||||
uint32_t sunxi_readl(volatile uint32_t *addr);
|
||||
void sunxi_writel(volatile uint32_t *addr, uint32_t val);
|
||||
|
||||
uint32_t sunxi_readl(volatile uint32_t *addr);
|
||||
void sunxi_writel(volatile uint32_t *addr, uint32_t val);
|
||||
|
||||
int sunxi_setup(void);
|
||||
|
||||
|
@ -157,72 +152,68 @@ void sunxi_writel(volatile uint32_t *addr, uint32_t val);
|
|||
|
||||
int bpi_found = -1;
|
||||
|
||||
struct BPIBoards
|
||||
{
|
||||
const char *name;
|
||||
int gpioLayout;
|
||||
int model;
|
||||
int rev;
|
||||
int mem;
|
||||
int maker;
|
||||
int warranty;
|
||||
int *pinToGpio;
|
||||
int *physToGpio;
|
||||
int *pinTobcm;
|
||||
} ;
|
||||
struct BPIBoards {
|
||||
const char *name;
|
||||
int gpioLayout;
|
||||
int model;
|
||||
int rev;
|
||||
int mem;
|
||||
int maker;
|
||||
int warranty;
|
||||
int *pinToGpio;
|
||||
int *physToGpio;
|
||||
int *pinTobcm;
|
||||
};
|
||||
|
||||
typedef BPIBoards BpiBoardsType;
|
||||
static BpiBoardsType bpiboard[];
|
||||
|
||||
typedef BPIBoards BpiBoardsType;
|
||||
static BpiBoardsType bpiboard[];
|
||||
typedef struct sunxi_gpio {
|
||||
unsigned int CFG[4];
|
||||
unsigned int DAT;
|
||||
unsigned int DRV[2];
|
||||
unsigned int PULL[2];
|
||||
} sunxi_gpio_t;
|
||||
|
||||
/* gpio interrupt control */
|
||||
typedef struct sunxi_gpio_int {
|
||||
unsigned int CFG[3];
|
||||
unsigned int CTL;
|
||||
unsigned int STA;
|
||||
unsigned int DEB;
|
||||
} sunxi_gpio_int_t;
|
||||
|
||||
typedef struct sunxi_gpio_reg {
|
||||
struct sunxi_gpio gpio_bank[9];
|
||||
unsigned char res[0xbc];
|
||||
struct sunxi_gpio_int gpio_int;
|
||||
} sunxi_gpio_reg_t;
|
||||
|
||||
typedef struct sunxi_gpio {
|
||||
unsigned int CFG[4];
|
||||
unsigned int DAT;
|
||||
unsigned int DRV[2];
|
||||
unsigned int PULL[2];
|
||||
} sunxi_gpio_t;
|
||||
volatile uint32_t *pio_map;
|
||||
volatile uint32_t *r_pio_map;
|
||||
|
||||
/* gpio interrupt control */
|
||||
typedef struct sunxi_gpio_int {
|
||||
unsigned int CFG[3];
|
||||
unsigned int CTL;
|
||||
unsigned int STA;
|
||||
unsigned int DEB;
|
||||
} sunxi_gpio_int_t;
|
||||
volatile uint32_t *r_gpio_map;
|
||||
|
||||
typedef struct sunxi_gpio_reg {
|
||||
struct sunxi_gpio gpio_bank[9];
|
||||
unsigned char res[0xbc];
|
||||
struct sunxi_gpio_int gpio_int;
|
||||
} sunxi_gpio_reg_t;
|
||||
|
||||
volatile uint32_t *pio_map;
|
||||
volatile uint32_t *r_pio_map;
|
||||
|
||||
volatile uint32_t *r_gpio_map;
|
||||
|
||||
uint8_t* gpio_mmap_reg;
|
||||
uint32_t sunxi_capture_all_gpio();
|
||||
void set_pullupdn(int gpio, int pud);
|
||||
|
||||
// These definitions are from c_gpio.c and should be removed at some point!!
|
||||
const int SETUP_OK = 0;
|
||||
const int SETUP_DEVMEM_FAIL = 1;
|
||||
const int SETUP_MALLOC_FAIL = 2;
|
||||
const int SETUP_MMAP_FAIL = 3;
|
||||
const int SETUP_CPUINFO_FAIL = 4;
|
||||
const int SETUP_NOT_RPI_FAIL = 5;
|
||||
const int INPUT = 1; // is really 0 for control register!;
|
||||
const int OUTPUT = 0; // is really 1 for control register!;
|
||||
const int ALT0 = 4;
|
||||
const int HIGH = 1;
|
||||
const int LOW = 0;
|
||||
const int PUD_OFF = 0;
|
||||
const int PUD_DOWN = 1;
|
||||
const int PUD_UP = 2;
|
||||
void short_wait(void);
|
||||
uint8_t *gpio_mmap_reg;
|
||||
uint32_t sunxi_capture_all_gpio();
|
||||
void set_pullupdn(int gpio, int pud);
|
||||
|
||||
// These definitions are from c_gpio.c and should be removed at some point!!
|
||||
const int SETUP_OK = 0;
|
||||
const int SETUP_DEVMEM_FAIL = 1;
|
||||
const int SETUP_MALLOC_FAIL = 2;
|
||||
const int SETUP_MMAP_FAIL = 3;
|
||||
const int SETUP_CPUINFO_FAIL = 4;
|
||||
const int SETUP_NOT_RPI_FAIL = 5;
|
||||
const int INPUT = 1; // is really 0 for control register!;
|
||||
const int OUTPUT = 0; // is really 1 for control register!;
|
||||
const int ALT0 = 4;
|
||||
const int HIGH = 1;
|
||||
const int LOW = 0;
|
||||
const int PUD_OFF = 0;
|
||||
const int PUD_DOWN = 1;
|
||||
const int PUD_UP = 2;
|
||||
void short_wait(void);
|
||||
|
||||
SBC_Version::sbc_version_type sbc_version;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// SCSI Target Emulator RaSCSI Reloaded
|
||||
// for Raspberry Pi
|
||||
//
|
||||
// Copyright (C) 2022 akuker
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include "hal/pi_defs/bpi-gpio.h"
|
||||
#include "hal/sbc_version.h"
|
||||
#include "log.h"
|
||||
|
||||
shared_ptr<Banana_Pi_Gpio_Mapping> BPI_GPIO::GetBpiGpioMapping(SBC_Version::sbc_version_type sbc_version)
|
||||
{
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m1_m1p_r1_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m2_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m2m_1p1_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m2m_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m2p_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m2u_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m3_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m64_map;
|
||||
|
||||
switch (sbc_version) {
|
||||
case SBC_Version::sbc_version_type::sbc_raspberry_pi_1:
|
||||
case SBC_Version::sbc_version_type::sbc_raspberry_pi_2_3:
|
||||
case SBC_Version::sbc_version_type::sbc_raspberry_pi_4:
|
||||
throw std::invalid_argument("Should never get here. Can't have a Raspberry style Banana Pi");
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m1_plus:
|
||||
LOGWARN("Banana Pi M1P is not tested or officially supported. Use at your own risk");
|
||||
return make_shared<Banana_Pi_Gpio_Mapping>(banana_pi_m1_m1p_r1_map);
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m2_ultra:
|
||||
LOGWARN("Banana Pi M2 Ultra is not tested or officially supported. Use at your own risk");
|
||||
return make_shared<Banana_Pi_Gpio_Mapping>(banana_pi_m2u_map);
|
||||
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m2_berry:
|
||||
LOGWARN("Banana Pi M2 Berry is not tested or officially supported. Use at your own risk");
|
||||
// Note: ** I THINK ** M2 berry uses same mapping as M2 Ultra
|
||||
return make_shared<Banana_Pi_Gpio_Mapping>(banana_pi_m2u_map);
|
||||
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m2_plus:
|
||||
return make_shared<Banana_Pi_Gpio_Mapping>(banana_pi_m2p_map);
|
||||
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m2_zero:
|
||||
throw std::invalid_argument("Banana Pi M2 Zero is not implemented yet");
|
||||
break;
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m3:
|
||||
LOGWARN("Banana Pi M3 is not tested or officially supported. Use at your own risk");
|
||||
return make_shared<Banana_Pi_Gpio_Mapping>(banana_pi_m3_map);
|
||||
break;
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m4:
|
||||
throw std::invalid_argument("Banana Pi M4 is not implemented yet");
|
||||
break;
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m5:
|
||||
throw std::invalid_argument("Banana Pi M5 is not implemented yet");
|
||||
break;
|
||||
case SBC_Version::sbc_version_type::sbc_bananapi_m64:
|
||||
throw std::invalid_argument("Banana Pi M64 is not implemented yet");
|
||||
break;
|
||||
case SBC_Version::sbc_version_type::sbc_unknown:
|
||||
throw std::invalid_argument("Unknown banana pi type");
|
||||
break;
|
||||
}
|
||||
LOGERROR("Unhandled single board computer type");
|
||||
return nullptr;
|
||||
}
|
|
@ -23,6 +23,7 @@ SOFTWARE.
|
|||
|
||||
#pragma once
|
||||
#include "hal/board_type.h"
|
||||
#include "hal/sbc_version.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
|
@ -378,12 +379,17 @@ extern const Banana_Pi_Gpio_Mapping banana_pi_m2u_map;
|
|||
extern const Banana_Pi_Gpio_Mapping banana_pi_m3_map;
|
||||
extern const Banana_Pi_Gpio_Mapping banana_pi_m64_map;
|
||||
|
||||
extern int physToGpio_BPI_M1P[64];
|
||||
extern int physToGpio_BPI_M2[64];
|
||||
extern int physToGpio_BPI_M2M[64];
|
||||
extern int physToGpio_BPI_M2M_1P1[64];
|
||||
extern int physToGpio_BPI_M2P[64];
|
||||
extern int physToGpio_BPI_M2U[64];
|
||||
extern int physToGpio_BPI_M3[64];
|
||||
extern int physToGpio_BPI_M64[64];
|
||||
|
||||
extern int physToGpio_BPI_M1P [64];
|
||||
extern int physToGpio_BPI_M2 [64];
|
||||
extern int physToGpio_BPI_M2M [64];
|
||||
extern int physToGpio_BPI_M2M_1P1 [64];
|
||||
extern int physToGpio_BPI_M2P [64];
|
||||
extern int physToGpio_BPI_M2U [64];
|
||||
extern int physToGpio_BPI_M3 [64];
|
||||
extern int physToGpio_BPI_M64 [64];
|
||||
class BPI_GPIO
|
||||
{
|
||||
public:
|
||||
static shared_ptr<Banana_Pi_Gpio_Mapping> GetBpiGpioMapping(SBC_Version::sbc_version_type sbc_version);
|
||||
};
|
||||
|
|
|
@ -17,14 +17,18 @@
|
|||
|
||||
SBC_Version::sbc_version_type SBC_Version::m_sbc_version = sbc_version_type::sbc_unknown;
|
||||
|
||||
// TODO: THESE NEED TO BE VALIDATED!!!!
|
||||
const std::string SBC_Version::m_str_raspberry_pi_1 = "Raspberry Pi 1";
|
||||
const std::string SBC_Version::m_str_raspberry_pi_2_3 = "Raspberry Pi 2/3";
|
||||
const std::string SBC_Version::m_str_raspberry_pi_4 = "Raspberry Pi 4";
|
||||
const std::string SBC_Version::m_str_bananapi_m1_plus = "Banana Pi M1 Plus";
|
||||
const std::string SBC_Version::m_str_bananapi_m2_berry = "Banana Pi M2 Berry/Ultra";
|
||||
const std::string SBC_Version::m_str_bananapi_m2_zero = "Banana Pi M2 Zero";
|
||||
const std::string SBC_Version::m_str_bananapi_m2_plus = "Banana Pi BPI-M2-Plus H3";
|
||||
const std::string SBC_Version::m_str_bananapi_m3 = "Banana Pi M3";
|
||||
const std::string SBC_Version::m_str_bananapi_m4 = "Banana Pi M4";
|
||||
const std::string SBC_Version::m_str_bananapi_m5 = "Banana Pi M5";
|
||||
const std::string SBC_Version::m_str_bananapi_m64 = "Banana Pi M64";
|
||||
const std::string SBC_Version::m_str_unknown_sbc = "Unknown SBC";
|
||||
|
||||
// The strings in this table should align with the 'model' embedded
|
||||
|
|
|
@ -28,11 +28,15 @@ class SBC_Version
|
|||
sbc_raspberry_pi_1,
|
||||
sbc_raspberry_pi_2_3,
|
||||
sbc_raspberry_pi_4,
|
||||
sbc_bananapi_m1_plus,
|
||||
sbc_bananapi_m2_ultra,
|
||||
sbc_bananapi_m2_berry,
|
||||
sbc_bananapi_m2_zero,
|
||||
sbc_bananapi_m2_plus,
|
||||
sbc_bananapi_m3,
|
||||
sbc_bananapi_m4,
|
||||
sbc_bananapi_m5,
|
||||
sbc_bananapi_m64,
|
||||
};
|
||||
|
||||
SBC_Version() = delete;
|
||||
|
@ -55,11 +59,15 @@ class SBC_Version
|
|||
static const std::string m_str_raspberry_pi_1;
|
||||
static const std::string m_str_raspberry_pi_2_3;
|
||||
static const std::string m_str_raspberry_pi_4;
|
||||
static const std::string m_str_bananapi_m1_plus;
|
||||
static const std::string m_str_bananapi_m2_ultra;
|
||||
static const std::string m_str_bananapi_m2_berry;
|
||||
static const std::string m_str_bananapi_m2_zero;
|
||||
static const std::string m_str_bananapi_m2_plus;
|
||||
static const std::string m_str_bananapi_m3;
|
||||
static const std::string m_str_bananapi_m4;
|
||||
static const std::string m_str_bananapi_m5;
|
||||
static const std::string m_str_bananapi_m64;
|
||||
static const std::string m_str_unknown_sbc;
|
||||
|
||||
static const std::map<std::string, sbc_version_type, std::less<>> m_proc_device_tree_mapping;
|
||||
|
|
Loading…
Reference in New Issue