extern int ar7240_ddr_find_size(void);
extern void ar933x_ddr_tap_init(void);
-// get button status
-#ifndef GPIO_RST_BUTTON_BIT
- #error "GPIO_RST_BUTTON_BIT not defined!"
-#endif
-int reset_button_status(void)
-{
- unsigned int gpio;
-
- gpio = ar7240_reg_rd(AR7240_GPIO_IN);
-
- if(gpio & (1 << GPIO_RST_BUTTON_BIT)){
-#if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
- return(0);
-#else
- return(1);
-#endif
- } else {
-#if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
- return(1);
-#else
- return(0);
-#endif
- }
-}
-
int ar7240_mem_config(void)
{
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
extern int ath_ddr_initial_config(uint32_t refresh);
extern int ath_ddr_find_size(void);
-int reset_button_status(void)
-{
-#ifndef GPIO_RST_BUTTON_BIT
- return 0;
-#else
- u32 gpio = qca_soc_reg_read(QCA_GPIO_IN_REG);
-
- if(gpio & (1 << GPIO_RST_BUTTON_BIT)){
- #if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
- return 0 ;
- #else
- return 1 ;
- #endif
- } else {
- #if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
- return 1;
- #else
- return 0;
- #endif
- }
-#endif
-}
-
void ath_set_tuning_caps(void)
{
typedef struct {
/*
- * Copyright (C) 2015 Piotr Dymacz <piotr@dymacz.pl>
+ * Common functions for QC/A WiSoCs support
+ * Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
*
- * SPDX-License-Identifier:GPL-2.0
+ * SPDX-License-Identifier: GPL-2.0
*/
#include <config.h>
memcpy(mac_addr, buffer, 6);
}
+/*
+ * Returns "reset button" status:
+ * 1 -> button is pressed
+ * 0 -> button is not pressed
+ */
+int reset_button_status(void)
+{
+#ifdef GPIO_RST_BUTTON_BIT
+ u32 gpio;
+
+ gpio = qca_soc_reg_read(QCA_GPIO_IN_REG);
+
+ if (gpio & (1 << GPIO_RST_BUTTON_BIT)) {
+ #if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
+ return 0;
+ #else
+ return 1;
+ #endif
+ } else {
+ #if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
+ return 1;
+ #else
+ return 0;
+ #endif
+ }
+#else
+ return 0;
+#endif
+}
+
/*
* Returns main CPU clock in Hz
*/
extern int wasp_ddr_initial_config(uint32_t refresh);
extern int ar7240_ddr_find_size(void);
-// get button status
-#ifndef GPIO_RST_BUTTON_BIT
- #error "GPIO_RST_BUTTON_BIT not defined!"
-#endif
-int reset_button_status(void)
-{
- unsigned int gpio;
-
- gpio = ar7240_reg_rd(AR934X_GPIO_IN);
-
- if(gpio & (1 << GPIO_RST_BUTTON_BIT)){
-#if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
- return 0;
-#else
- return 1;
-#endif
- } else {
-#if defined(GPIO_RST_BUTTON_IS_ACTIVE_LOW)
- return 1;
-#else
- return 0;
-#endif
- }
-}
-
void ath_set_tuning_caps(void)
{
typedef struct {