1 /*
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>
10 #include <asm/arch/clk.h>
11 #include <asm/arch/sama5d2.h>
12 
13 char *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
48 void at91_udp_hw_init(void)
49 {
50 	at91_upll_clk_enable();
51 
52 	at91_periph_clk_enable(ATMEL_ID_UDPHS);
53 }
54 #endif
55