2018-11-16 12:10:55 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Synopsys, Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-12-12 19:16:36 +08:00
|
|
|
* This module provides routines to initialize and support soc-level hardware
|
2018-11-16 12:10:55 +08:00
|
|
|
* for the IoT Development Kit board.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <device.h>
|
|
|
|
#include <init.h>
|
|
|
|
#include "sysconf.h"
|
|
|
|
|
2020-04-29 00:15:57 +08:00
|
|
|
#define CPU_FREQ DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static int arc_iot_init(const struct device *dev)
|
2018-11-16 12:10:55 +08:00
|
|
|
{
|
|
|
|
ARG_UNUSED(dev);
|
|
|
|
|
2020-04-29 00:15:57 +08:00
|
|
|
if (arc_iot_pll_fout_config(CPU_FREQ / 1000000) < 0) {
|
2018-11-16 12:10:55 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(arc_iot_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|