1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#include <platsupport/io.h> 14#include "devcfg.h" 15 16#define DEVCFG_PADDR 0xF8007000 17#define DEVCFG_SIZE 0x1000 18 19static devcfg_regs_t* devcfg_regs = NULL; 20 21int devcfg_init(ps_io_ops_t* ops) { 22 if (devcfg_regs == NULL) { 23 devcfg_regs = ps_io_map(&ops->io_mapper, DEVCFG_PADDR, DEVCFG_SIZE, false /* cached */, PS_MEM_NORMAL); 24 } 25 26 return 0; 27} 28 29devcfg_regs_t* devcfg_get_regs(void) { 30 return devcfg_regs; 31} 32