1 /*
2  * Copyright (C) 2014 Atmel
3  *		      Bo Shen <voice.shen@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/at91_common.h>
11 #include <asm/arch/at91_pmc.h>
12 #include <asm/arch/clk.h>
13 #include <asm/arch/sama5_sfr.h>
14 #include <asm/arch/sama5d4.h>
15 
16 char *get_cpu_name()
17 {
18 	unsigned int extension_id = get_extension_chip_id();
19 
20 	if (cpu_is_sama5d4())
21 		switch (extension_id) {
22 		case ARCH_EXID_SAMA5D41:
23 			return "SAMA5D41";
24 		case ARCH_EXID_SAMA5D42:
25 			return "SAMA5D42";
26 		case ARCH_EXID_SAMA5D43:
27 			return "SAMA5D43";
28 		case ARCH_EXID_SAMA5D44:
29 			return "SAMA5D44";
30 		default:
31 			return "Unknown CPU type";
32 		}
33 	else
34 		return "Unknown CPU type";
35 }
36 
37 #ifdef CONFIG_USB_GADGET_ATMEL_USBA
38 void at91_udp_hw_init(void)
39 {
40 	struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
41 
42 	/* Enable UPLL clock */
43 	writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr);
44 	/* Enable UDPHS clock */
45 	at91_periph_clk_enable(ATMEL_ID_UDPHS);
46 }
47 #endif
48