Skip to content

Commit

Permalink
Base Rockchip platfrom drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
GuEe-GUI committed Nov 15, 2023
1 parent 80d7885 commit d343b1e
Show file tree
Hide file tree
Showing 336 changed files with 49,847 additions and 3,972 deletions.
2 changes: 1 addition & 1 deletion bsp/hpmicro/hpm6750evk/board/eth_phy_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ eth_phy_monitor_handle_t phy_monitor_handle =

static struct rt_phy_ops phy_ops;

static rt_phy_status phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
static rt_phy_status phy_init(rt_phy_t *phy, void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
{
return PHY_STATUS_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/hpmicro/hpm6750evkmini/board/eth_phy_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ eth_phy_monitor_handle_t phy_monitor_handle =

static struct rt_phy_ops phy_ops;

static rt_phy_status phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
static rt_phy_status phy_init(rt_phy_t *phy, void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
{
return PHY_STATUS_OK;
}
Expand Down
12 changes: 6 additions & 6 deletions bsp/imxrt/libraries/drivers/drv_ksz8081.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static inline rt_bool_t write_reg(rt_mdio_t *bus, rt_uint32_t addr, rt_uint32_t
return RT_TRUE;
}

static rt_phy_status rt_phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
static rt_phy_status rt_phy_init(struct rt_phy_device *phy, void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
{
rt_bool_t ret;
rt_phy_status result;
Expand Down Expand Up @@ -208,7 +208,7 @@ static rt_phy_status rt_phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t
}


static rt_phy_status rt_phy_read(rt_uint32_t reg, rt_uint32_t *data)
static rt_phy_status rt_phy_read(struct rt_phy_device *phy, rt_uint32_t reg, rt_uint32_t *data)
{
rt_mdio_t *mdio_bus = phy_ksz8081.bus;
rt_uint32_t device_id = phy_ksz8081.addr;
Expand All @@ -220,7 +220,7 @@ static rt_phy_status rt_phy_read(rt_uint32_t reg, rt_uint32_t *data)
return PHY_STATUS_FAIL;
}

static rt_phy_status rt_phy_write(rt_uint32_t reg, rt_uint32_t data)
static rt_phy_status rt_phy_write(struct rt_phy_device *phy, rt_uint32_t reg, rt_uint32_t data)
{
rt_mdio_t *mdio_bus = phy_ksz8081.bus;
rt_uint32_t device_id = phy_ksz8081.addr;
Expand All @@ -232,7 +232,7 @@ static rt_phy_status rt_phy_write(rt_uint32_t reg, rt_uint32_t data)
return PHY_STATUS_FAIL;
}

static rt_phy_status rt_phy_loopback(rt_uint32_t mode, rt_uint32_t speed, rt_bool_t enable)
static rt_phy_status rt_phy_loopback(struct rt_phy_device *phy, rt_uint32_t mode, rt_uint32_t speed, rt_bool_t enable)
{
rt_uint32_t data = 0;
rt_phy_status result;
Expand Down Expand Up @@ -288,7 +288,7 @@ static rt_phy_status rt_phy_loopback(rt_uint32_t mode, rt_uint32_t speed, rt_boo
return result;
}

static rt_phy_status get_link_status(rt_bool_t *status)
static rt_phy_status get_link_status(struct rt_phy_device *phy, rt_bool_t *status)
{
rt_phy_status result;
rt_uint32_t data;
Expand All @@ -310,7 +310,7 @@ static rt_phy_status get_link_status(rt_bool_t *status)
}
return result;
}
static rt_phy_status get_link_speed_duplex(rt_uint32_t *speed, rt_uint32_t *duplex)
static rt_phy_status get_link_speed_duplex(struct rt_phy_device *phy, rt_uint32_t *speed, rt_uint32_t *duplex)
{
rt_phy_status result = PHY_STATUS_OK;
rt_uint32_t data, ctl_reg;
Expand Down
12 changes: 6 additions & 6 deletions bsp/imxrt/libraries/drivers/drv_rtl8211f.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static status_t PHY_RTL8211F_MMD_Write(uint8_t device, uint16_t addr, uint32_t d
return result;
}

static rt_phy_status rt_phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
static rt_phy_status rt_phy_init(struct rt_phy_device *phy, void *object, rt_uint32_t phy_addr, rt_uint32_t src_clock_hz)
{
rt_bool_t ret;
rt_phy_status result;
Expand Down Expand Up @@ -309,7 +309,7 @@ static rt_phy_status rt_phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t
return result;
}

static rt_phy_status rt_phy_read(rt_uint32_t reg, rt_uint32_t *data)
static rt_phy_status rt_phy_read(struct rt_phy_device *phy, rt_uint32_t reg, rt_uint32_t *data)
{
rt_mdio_t *mdio_bus = phy_rtl8211f.bus;
rt_uint32_t device_id = phy_rtl8211f.addr;
Expand All @@ -321,7 +321,7 @@ static rt_phy_status rt_phy_read(rt_uint32_t reg, rt_uint32_t *data)
return PHY_STATUS_FAIL;
}

static rt_phy_status rt_phy_write(rt_uint32_t reg, rt_uint32_t data)
static rt_phy_status rt_phy_write(struct rt_phy_device *phy, rt_uint32_t reg, rt_uint32_t data)
{
rt_mdio_t *mdio_bus = phy_rtl8211f.bus;
rt_uint32_t device_id = phy_rtl8211f.addr;
Expand All @@ -333,7 +333,7 @@ static rt_phy_status rt_phy_write(rt_uint32_t reg, rt_uint32_t data)
return PHY_STATUS_FAIL;
}

static rt_phy_status rt_phy_loopback(rt_uint32_t mode, rt_uint32_t speed, rt_bool_t enable)
static rt_phy_status rt_phy_loopback(struct rt_phy_device *phy, rt_uint32_t mode, rt_uint32_t speed, rt_bool_t enable)
{
/* This PHY only supports local loopback. */
// rt_assert(mode == PHY_LOCAL_LOOP);
Expand Down Expand Up @@ -371,7 +371,7 @@ static rt_phy_status rt_phy_loopback(rt_uint32_t mode, rt_uint32_t speed, rt_boo
return result;
}

static rt_phy_status get_link_status(rt_bool_t *status)
static rt_phy_status get_link_status(struct rt_phy_device *phy, rt_bool_t *status)
{
// assert(status);

Expand All @@ -396,7 +396,7 @@ static rt_phy_status get_link_status(rt_bool_t *status)
return result;
}

static rt_phy_status get_link_speed_duplex(rt_uint32_t *speed, rt_uint32_t *duplex)
static rt_phy_status get_link_speed_duplex(struct rt_phy_device *phy, rt_uint32_t *speed, rt_uint32_t *duplex)
{
// assert(!((speed == NULL) && (duplex == NULL)));

Expand Down
94 changes: 64 additions & 30 deletions bsp/qemu-virt64-aarch64/.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CONFIG_RT_USING_MESSAGEQUEUE=y
# Memory Management
#
CONFIG_RT_PAGE_MAX_ORDER=11
# CONFIG_RT_USING_MEMPOOL is not set
CONFIG_RT_USING_MEMPOOL=y
# CONFIG_RT_USING_SMALL_MEM is not set
CONFIG_RT_USING_SLAB=y
CONFIG_RT_USING_MEMHEAP=y
Expand Down Expand Up @@ -174,6 +174,7 @@ CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512
CONFIG_RT_DFS_ELM_REENTRANT=y
CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
CONFIG_RT_USING_DFS_DEVFS=y
CONFIG_RT_USING_DFS_DIRECTFS=y
CONFIG_RT_USING_DFS_ROMFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set
Expand All @@ -192,30 +193,37 @@ CONFIG_RT_LWP_SHM_MAX_NR=64
#
# Device Drivers
#
CONFIG_RT_USING_DEVICE_IPC=y
CONFIG_RT_UNAMED_PIPE_NUMBER=64
CONFIG_RT_USING_SYSTEM_WORKQUEUE=y
CONFIG_RT_SYSTEM_WORKQUEUE_STACKSIZE=8192
CONFIG_RT_SYSTEM_WORKQUEUE_PRIORITY=23
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_USING_CPUTIME is not set
# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_USING_PHY is not set
# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
CONFIG_RT_USING_NULL=y
CONFIG_RT_USING_ZERO=y
CONFIG_RT_USING_RANDOM=y
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_SDIO is not set
# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_LCD is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
CONFIG_RT_USING_DEV_BUS=y
# CONFIG_RT_USING_WIFI is not set
CONFIG_RT_USING_DEVICE_IPC=y
CONFIG_RT_UNAMED_PIPE_NUMBER=64
CONFIG_RT_USING_SYSTEM_WORKQUEUE=y
CONFIG_RT_SYSTEM_WORKQUEUE_STACKSIZE=8192
CONFIG_RT_SYSTEM_WORKQUEUE_PRIORITY=23
# CONFIG_RT_USING_ADC is not set
CONFIG_RT_USING_AUDIO=y
CONFIG_RT_AUDIO_REPLAY_MP_BLOCK_SIZE=4096
CONFIG_RT_AUDIO_REPLAY_MP_BLOCK_COUNT=2
CONFIG_RT_AUDIO_RECORD_PIPE_SIZE=2048
CONFIG_RT_AUDIO_INTEL_HDA=y
# CONFIG_RT_AUDIO_ROCKCHIP is not set
# CONFIG_RT_USING_CAN is not set
CONFIG_RT_USING_CLK=y
# CONFIG_RT_CLK_ROCKCHIP is not set
CONFIG_RT_USING_FIRMWARE=y
CONFIG_RT_FIRMWARE_PSCI=y
CONFIG_RT_FIRMWARE_QEMU_FW_CFG=y
CONFIG_RT_USING_HWCRYPTO=y
CONFIG_RT_HWCRYPTO_DEFAULT_NAME="hwcryto"
CONFIG_RT_HWCRYPTO_IV_MAX_SIZE=16
Expand All @@ -231,65 +239,91 @@ CONFIG_RT_HWCRYPTO_KEYBIT_MAX_SIZE=256
CONFIG_RT_HWCRYPTO_USING_RNG=y
# CONFIG_RT_HWCRYPTO_USING_CRC is not set
# CONFIG_RT_HWCRYPTO_USING_BIGNUM is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
CONFIG_RT_USING_DEV_BUS=y
# CONFIG_RT_USING_WIFI is not set
CONFIG_RT_USING_CLK=y
CONFIG_RT_USING_FIRMWARE=y
CONFIG_RT_FIRMWARE_PSCI=y
# CONFIG_RT_HWCRYPTO_RNG_ROCKCHIP is not set
# CONFIG_RT_USING_HWSPINLOCK is not set
CONFIG_RT_USING_HWTIMER=y
CONFIG_RT_HWTIMER_ARM_ARCH=y
# CONFIG_RT_HWTIMER_RISCV_CLINT is not set
# CONFIG_RT_HWTIMER_BCM2835 is not set
# CONFIG_RT_HWTIMER_ROCKCHIP is not set
# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_USING_MBOX is not set
# CONFIG_RT_USING_MFD is not set
# CONFIG_RT_USING_MTD_NAND is not set
CONFIG_RT_USING_MTD_NOR=y
CONFIG_RT_USING_MTD_NOR_CFI=y
CONFIG_RT_USING_OFW=y
# CONFIG_RT_USING_BUILTIN_FDT is not set
CONFIG_RT_FDT_EARLYCON_MSG_SIZE=128
CONFIG_RT_USING_OFW_DIRECTFS=y
CONFIG_RT_USING_PCI=y
CONFIG_RT_PCI_MSI=y
CONFIG_RT_PCI_SYS_64BIT=y
CONFIG_RT_PCI_CACHE_LINE_SIZE=8
# CONFIG_RT_PCI_LOCKLESS is not set
CONFIG_RT_PCI_ECAM=y
CONFIG_RT_PCI_HOST_COMMON=y
CONFIG_RT_PCI_HOST_GENERIC=y
# CONFIG_RT_PCI_DW_HOST is not set
# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIC=y
CONFIG_MAX_HANDLERS=512
# CONFIG_RT_PIC_BCM2835_INTC is not set
# CONFIG_RT_PIC_BCM2836_L1_INTC is not set
CONFIG_RT_PIC_ARM_GIC=y
# CONFIG_RT_PIC_ARM_GIC_V2M is not set
CONFIG_RT_PIC_ARM_GIC_V2M=y
CONFIG_RT_PIC_ARM_GIC_V3=y
# CONFIG_RT_PIC_ARM_GIC_V3_ITS is not set
CONFIG_RT_PIC_ARM_GIC_MAX_NR=1
# CONFIG_RT_PIC_RISCV_INTC is not set
# CONFIG_RT_PIC_SIFIVE_PLIC is not set
CONFIG_RT_USING_PINCTRL=y
# CONFIG_RT_PINCTRL_ROCKCHIP is not set
CONFIG_RT_USING_PIN=y
CONFIG_RT_PIN_PL061=y
# CONFIG_RT_PIN_ROCKCHIP is not set
CONFIG_RT_USING_PM=y
CONFIG_PM_TICKLESS_THRESHOLD_TIME=2
# CONFIG_PM_USING_CUSTOM_CONFIG is not set
# CONFIG_PM_ENABLE_DEBUG is not set
# CONFIG_PM_ENABLE_SUSPEND_SLEEP_MODE is not set
# CONFIG_PM_ENABLE_THRESHOLD_SLEEP_MODE is not set
# CONFIG_RT_PM_RESET_SYSCON is not set
# CONFIG_RT_PM_RESET_SYSCON_POWEROFF is not set
# CONFIG_RT_PM_BCM2835 is not set
# CONFIG_RT_PM_SYSCON_POWEROFF is not set
# CONFIG_RT_PM_SYSCON_REBOOT is not set
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_REGULATOR is not set
# CONFIG_RT_USING_RESET is not set
CONFIG_RT_USING_RTC=y
CONFIG_RT_USING_ALARM=y
# CONFIG_RT_USING_SOFT_RTC is not set
CONFIG_RT_RTC_PL031=y
# CONFIG_RT_RTC_GOLDFISH is not set
# CONFIG_RT_RTC_HYM8563 is not set
CONFIG_RT_RTC_PL031=y
# CONFIG_RT_RTC_RK_TIMER is not set
# CONFIG_RT_USING_SDIO is not set
# CONFIG_RT_USING_SENSOR is not set
CONFIG_RT_USING_SERIAL=y
CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=256
CONFIG_RT_SERIAL_PL011=y
CONFIG_RT_SERIAL_8250=y
# CONFIG_RT_SERIAL_8250_BCM2835AUX is not set
# CONFIG_RT_SERIAL_8250_DW is not set
# CONFIG_RT_SERIAL_8250_OFW is not set
CONFIG_RT_SERIAL_8250_PCI=y
CONFIG_RT_USING_SOC=y
# CONFIG_RT_SOC_ROCKCHIP is not set
# CONFIG_RT_USING_SPI is not set
CONFIG_RT_USING_VIRTIO=y
CONFIG_RT_VIRTIO_TRANSPORT_MMIO=y
CONFIG_RT_VIRTIO_TRANSPORT_PCI=y
CONFIG_RT_VIRTIO_NET=y
CONFIG_RT_VIRTIO_BLK=y
CONFIG_RT_VIRTIO_CONSOLE=y
CONFIG_RT_VIRTIO_RNG=y
CONFIG_RT_VIRTIO_GPU=y
CONFIG_RT_VIRTIO_INPUT=y
# CONFIG_RT_USING_WDT is not set

#
# Using USB
Expand Down
10 changes: 9 additions & 1 deletion bsp/qemu-virt64-aarch64/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@

int main(int argc, char** argv)
{
const char *oem;

#ifdef RT_USING_SMART
oem = "Smart";
#else
oem = "Thread";
#endif

rt_ubase_t level = rt_hw_interrupt_disable();

rt_kprintf("Hi, this is RT-Thread!!\n");
rt_kprintf("Hi, this is RT-%s!!\n", oem);

rt_hw_interrupt_enable(level);

Expand Down
13 changes: 6 additions & 7 deletions bsp/qemu-virt64-aarch64/applications/pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

#define LINUX_KEY_POWER 116 /* SC System Power Down */

void linux_key_poweroff(void *args)
static void linux_key_poweroff(void *args)
{
rt_kputs("\n");
LOG_I("Power off the machine by [%s]", args);

rt_hw_cpu_shutdown();
Expand All @@ -39,9 +40,9 @@ static int pin_init()

rt_ofw_foreach_child_node(gpio_keys_np, key)
{
struct rt_ofw_cell_args args;
rt_base_t pin = rt_ofw_get_named_pin(key, RT_NULL, 0, RT_NULL, RT_NULL);

if (!rt_ofw_parse_phandle_cells(key, "gpios", "#gpio-cells", 0, &args))
if (pin >= 0)
{
rt_uint32_t linux_code;
void *key_args = RT_NULL;
Expand All @@ -61,11 +62,9 @@ static int pin_init()

if (fn_ptr)
{
rt_pin_attach_irq(args.args[0], args.args[1], fn_ptr, key_args);
rt_pin_irq_enable(args.args[0], RT_TRUE);
rt_pin_attach_irq(pin, PIN_IRQ_PIN_NONE, fn_ptr, key_args);
rt_pin_irq_enable(pin, RT_TRUE);
}

rt_ofw_node_put(args.data);
}
}

Expand Down
Loading

0 comments on commit d343b1e

Please sign in to comment.