Created
August 7, 2016 15:50
-
-
Save toddkuhreng/2db3e5a79f366bcb8e51d5f76d986231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_phys_mem(MEM_AREA_IO_NSEC, GPIO2_BASE, 0x1000); | |
static struct pl061_data platform_pl061_data; | |
static vaddr_t gpio2_base(void) | |
{ | |
static void *va4; | |
if (cpu_mmu_enabled()) { | |
if (!va4) | |
va4 = phys_to_virt(GPIO2_BASE, MEM_AREA_IO_NSEC); | |
return (vaddr_t)va4; | |
} | |
return GPIO2_BASE; | |
} | |
void do_some_gpio_calls(void) | |
{ | |
// platform_pl061_data.chip.ops->set_value(23, GPIO_LEVEL_HIGH); | |
// platform_pl061_data.chip.ops->set_direction(23, GPIO_DIR_OUT); | |
} | |
static TEE_Result init_gpio(void) | |
{ | |
pl061_init(&platform_pl061_data); | |
pl061_register(gpio2_base(), 2); | |
return TEE_SUCCESS; | |
} | |
driver_init(init_gpio); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment