Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Bo Shen | 5864590 | 2014-11-10 15:24:02 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2014 Atmel |
| 4 | * Bo Shen <voice.shen@atmel.com> |
Bo Shen | 5864590 | 2014-11-10 15:24:02 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 7 | #include <asm/io.h> |
| 8 | #include <asm/arch/at91_common.h> |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 9 | #include <asm/arch/clk.h> |
Tudor Ambarus | 680897a | 2019-09-27 13:09:00 +0000 | [diff] [blame] | 10 | #include <asm/arch/at91_sfr.h> |
Bo Shen | 5864590 | 2014-11-10 15:24:02 +0800 | [diff] [blame] | 11 | #include <asm/arch/sama5d4.h> |
| 12 | |
| 13 | char *get_cpu_name() |
| 14 | { |
| 15 | unsigned int extension_id = get_extension_chip_id(); |
| 16 | |
| 17 | if (cpu_is_sama5d4()) |
| 18 | switch (extension_id) { |
| 19 | case ARCH_EXID_SAMA5D41: |
| 20 | return "SAMA5D41"; |
| 21 | case ARCH_EXID_SAMA5D42: |
| 22 | return "SAMA5D42"; |
| 23 | case ARCH_EXID_SAMA5D43: |
| 24 | return "SAMA5D43"; |
| 25 | case ARCH_EXID_SAMA5D44: |
| 26 | return "SAMA5D44"; |
| 27 | default: |
| 28 | return "Unknown CPU type"; |
| 29 | } |
| 30 | else |
| 31 | return "Unknown CPU type"; |
| 32 | } |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 33 | |
| 34 | #ifdef CONFIG_USB_GADGET_ATMEL_USBA |
| 35 | void at91_udp_hw_init(void) |
| 36 | { |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 37 | /* Enable UPLL clock */ |
Wenyou Yang | b5d886a | 2016-02-02 11:11:52 +0800 | [diff] [blame] | 38 | at91_upll_clk_enable(); |
Bo Shen | 3d1d9c5 | 2014-12-03 18:02:19 +0800 | [diff] [blame] | 39 | /* Enable UDPHS clock */ |
| 40 | at91_periph_clk_enable(ATMEL_ID_UDPHS); |
| 41 | } |
| 42 | #endif |