Skip to content

Commit

Permalink
ayufan: pinebook-pro: power work/diy leds on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Apr 7, 2020
1 parent c93d709 commit dc530db
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions board/pine64/pinebook_pro_rk3399/pinebook_pro-rk3399.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,30 @@
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch-rockchip/clock.h>
#include <asm/arch-rockchip/gpio.h>
#include <asm/arch-rockchip/grf_rk3399.h>
#include <asm/arch-rockchip/hardware.h>
#include <asm/arch-rockchip/misc.h>
#include <dt-bindings/pinctrl/rockchip.h>

#define GRF_IO_VSEL_BT565_SHIFT 0
#define PMUGRF_CON0_VSEL_SHIFT 8

int board_early_init_f(void)
{
#define GPIO0_BASE 0xff720000

struct rockchip_gpio_regs * const gpio0 = (void *)GPIO0_BASE;

// set GPIO0_A2/B3 to GPIO_ACTIVE_HIGH
// set GPIO0_A2/B3 to OUTPUT
int mask = (1UL << RK_PA2) | (1UL << RK_PB3);
setbits_le32(&gpio0->swport_dr, mask);
setbits_le32(&gpio0->swport_ddr, mask);

return 0;
}

#ifdef CONFIG_MISC_INIT_R
static void setup_iodomain(void)
{
Expand Down

0 comments on commit dc530db

Please sign in to comment.