blob: 5c693df2ecf062bf28e7ab53dc976e6e6a5059d0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Bo Shen58645902014-11-10 15:24:02 +08002/*
3 * Copyright (C) 2014 Atmel
4 * Bo Shen <voice.shen@atmel.com>
Bo Shen58645902014-11-10 15:24:02 +08005 */
6
7#include <common.h>
Bo Shen3d1d9c52014-12-03 18:02:19 +08008#include <asm/io.h>
9#include <asm/arch/at91_common.h>
Bo Shen3d1d9c52014-12-03 18:02:19 +080010#include <asm/arch/clk.h>
Bo Shene1ec15c2014-12-15 13:24:35 +080011#include <asm/arch/sama5_sfr.h>
Bo Shen58645902014-11-10 15:24:02 +080012#include <asm/arch/sama5d4.h>
13
14char *get_cpu_name()
15{
16 unsigned int extension_id = get_extension_chip_id();
17
18 if (cpu_is_sama5d4())
19 switch (extension_id) {
20 case ARCH_EXID_SAMA5D41:
21 return "SAMA5D41";
22 case ARCH_EXID_SAMA5D42:
23 return "SAMA5D42";
24 case ARCH_EXID_SAMA5D43:
25 return "SAMA5D43";
26 case ARCH_EXID_SAMA5D44:
27 return "SAMA5D44";
28 default:
29 return "Unknown CPU type";
30 }
31 else
32 return "Unknown CPU type";
33}
Bo Shen3d1d9c52014-12-03 18:02:19 +080034
35#ifdef CONFIG_USB_GADGET_ATMEL_USBA
36void at91_udp_hw_init(void)
37{
Bo Shen3d1d9c52014-12-03 18:02:19 +080038 /* Enable UPLL clock */
Wenyou Yangb5d886a2016-02-02 11:11:52 +080039 at91_upll_clk_enable();
Bo Shen3d1d9c52014-12-03 18:02:19 +080040 /* Enable UDPHS clock */
41 at91_periph_clk_enable(ATMEL_ID_UDPHS);
42}
43#endif