Bo Shen | 5864590 | 2014-11-10 15:24:02 +0800 | [diff] [blame] | 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> |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 9 | #include <asm/io.h> |
| 10 | #include <asm/arch/at91_common.h> |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 11 | #include <asm/arch/clk.h> |
Bo Shen | e1ec15c | 2014-12-15 13:24:35 +0800 | [diff] [blame] | 12 | #include <asm/arch/sama5_sfr.h> |
Bo Shen | 5864590 | 2014-11-10 15:24:02 +0800 | [diff] [blame] | 13 | #include <asm/arch/sama5d4.h> |
| 14 | |
| 15 | char *get_cpu_name() |
| 16 | { |
| 17 | unsigned int extension_id = get_extension_chip_id(); |
| 18 | |
| 19 | if (cpu_is_sama5d4()) |
| 20 | switch (extension_id) { |
| 21 | case ARCH_EXID_SAMA5D41: |
| 22 | return "SAMA5D41"; |
| 23 | case ARCH_EXID_SAMA5D42: |
| 24 | return "SAMA5D42"; |
| 25 | case ARCH_EXID_SAMA5D43: |
| 26 | return "SAMA5D43"; |
| 27 | case ARCH_EXID_SAMA5D44: |
| 28 | return "SAMA5D44"; |
| 29 | default: |
| 30 | return "Unknown CPU type"; |
| 31 | } |
| 32 | else |
| 33 | return "Unknown CPU type"; |
| 34 | } |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 35 | |
| 36 | #ifdef CONFIG_USB_GADGET_ATMEL_USBA |
| 37 | void at91_udp_hw_init(void) |
| 38 | { |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 39 | /* Enable UPLL clock */ |
Wenyou Yang | b5d886a | 2016-02-02 11:11:52 +0800 | [diff] [blame^] | 40 | at91_upll_clk_enable(); |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 41 | /* Enable UDPHS clock */ |
| 42 | at91_periph_clk_enable(ATMEL_ID_UDPHS); |
| 43 | } |
| 44 | #endif |