1 /* 2 * Copyright (c) 2022 HPMicro 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef _HPM_BOARD_H 17 #define _HPM_BOARD_H 18 #include <stdio.h> 19 #include "hpm_common.h" 20 #include "hpm_clock_drv.h" 21 #include "hpm_soc.h" 22 #include "hpm_soc_feature.h" 23 24 #define BOARD_CPU_FREQ (816000000UL) 25 26 27 /* enet section */ 28 #define BOARD_ENET_RGMII_RST_GPIO HPM_GPIO0 29 #define BOARD_ENET_RGMII_RST_GPIO_INDEX GPIO_DO_GPIOF 30 #define BOARD_ENET_RGMII_RST_GPIO_PIN (0U) 31 #define BOARD_ENET_RGMII HPM_ENET0 32 #define BOARD_ENET_RGMII_TX_DLY (5U) 33 #define BOARD_ENET_RGMII_RX_DLY (2U) 34 35 #define BOARD_ENET_RGMII_PTP_CLOCK (clock_ptp0) 36 37 38 #define BOARD_ENET_RMII_RST_GPIO HPM_GPIO0 39 #define BOARD_ENET_RMII_RST_GPIO_INDEX GPIO_DO_GPIOE 40 #define BOARD_ENET_RMII_RST_GPIO_PIN (26U) 41 #define BOARD_ENET_RMII HPM_ENET1 42 #define BOARD_ENET_RMII_INT_REF_CLK (1U) 43 44 #define BOARD_ENET_RMII_PTP_CLOCK (clock_ptp1) 45 46 47 48 void board_init(void); 49 void board_print_clock_freq(void); 50 void board_print_banner(void); 51 52 hpm_stat_t board_reset_enet_phy(ENET_Type *ptr); 53 hpm_stat_t board_init_enet_pins(ENET_Type *ptr); 54 hpm_stat_t board_init_enet_rmii_reference_clock(ENET_Type *ptr, bool internal); 55 hpm_stat_t board_init_enet_rgmii_clock_delay(ENET_Type *ptr); 56 hpm_stat_t board_init_enet_ptp_clock(ENET_Type *ptr); 57 58 #if defined(__cplusplus) 59 } 60 #endif /* __cplusplus */ 61 #endif /* _HPM_BOARD_H */ 62