blob: 978eac29bd74e89d5d45e46dde39252f4617b32e [file] [log] [blame]
Wenyou Yangc64a75a2015-10-30 09:55:52 +08001/*
2 * Copyright (C) 2015 Atmel Corporation
3 * Wenyou Yang <wenyou.yang@atmel.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <asm/io.h>
Wenyou Yangc64a75a2015-10-30 09:55:52 +080010#include <asm/arch/clk.h>
11#include <asm/arch/sama5d2.h>
12
13char *get_cpu_name()
14{
15 unsigned int extension_id = get_extension_chip_id();
16
17 if (cpu_is_sama5d2()) {
18 switch (extension_id) {
19 case ARCH_EXID_SAMA5D21CU:
20 return "SAMA5D21";
21 case ARCH_EXID_SAMA5D22CU:
22 return "SAMA5D22-CU";
23 case ARCH_EXID_SAMA5D22CN:
24 return "SAMA5D22-CN";
25 case ARCH_EXID_SAMA5D23CU:
26 return "SAMA5D23-CU";
27 case ARCH_EXID_SAMA5D24CX:
28 return "SAMA5D24-CX";
29 case ARCH_EXID_SAMA5D24CU:
30 return "SAMA5D24-CU";
31 case ARCH_EXID_SAMA5D26CU:
32 return "SAMA5D26-CU";
33 case ARCH_EXID_SAMA5D27CU:
34 return "SAMA5D27-CU";
35 case ARCH_EXID_SAMA5D27CN:
36 return "SAMA5D27-CN";
37 case ARCH_EXID_SAMA5D28CU:
38 return "SAMA5D28-CU";
39 case ARCH_EXID_SAMA5D28CN:
40 return "SAMA5D28-CN";
41 }
42 }
43
44 return "Unknown CPU type";
45}
46
47#ifdef CONFIG_USB_GADGET_ATMEL_USBA
48void at91_udp_hw_init(void)
49{
Wenyou Yangb5d886a2016-02-02 11:11:52 +080050 at91_upll_clk_enable();
Wenyou Yangc64a75a2015-10-30 09:55:52 +080051
52 at91_periph_clk_enable(ATMEL_ID_UDPHS);
53}
54#endif