ath10k: add basic skeleton to support ahb
qca4019 uses ahb instead of pci where it slightly differs in device
enumeration, clock control, reset control, etc. Good thing is that
ahb also uses copy engine for the data transaction. So, the most of
the stuff implemented in pci.c/ce.c are reusable in ahb case too.
Device enumeration in ahb case comes through platform driver/device
model. All resource details like irq, memory map, clocks, etc for
qca4019 can be fetched from of_node of platform device.
Simply flow would look like,
device tree => platform device (kernel) => platform driver (ath10k)
Device tree entry will have all qca4019 resource details and the same
info will be passed to kernel. Kernel will prepare new platform device
for that entry and expose DT info to of_node in platform device.
Later, ath10k would register platform driver with unique compatible name
and then kernels binds to corresponding compatible entry & calls ath10k
ahb probe functions. From there onwards, ath10k will take control of it
and move forward.
New bool flag CONFIG_ATH10K_AHB is added in Kconfig to conditionally
enable ahb support in ath10k. On enabling this flag, ath10k_pci.ko
will have ahb support. This patch adds only basic skeleton and few
macros to support ahb in the context of qca4019.
Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-01-27 17:54:25 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Qualcomm Atheros, Inc. All rights reserved.
|
|
|
|
* Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _AHB_H_
|
|
|
|
#define _AHB_H_
|
|
|
|
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
|
2016-01-27 17:54:27 +08:00
|
|
|
struct ath10k_ahb {
|
|
|
|
struct platform_device *pdev;
|
|
|
|
void __iomem *mem;
|
2016-01-27 17:54:32 +08:00
|
|
|
unsigned long mem_len;
|
2016-01-27 17:54:27 +08:00
|
|
|
void __iomem *gcc_mem;
|
|
|
|
void __iomem *tcsr_mem;
|
2016-01-27 17:54:28 +08:00
|
|
|
|
2016-01-27 17:54:31 +08:00
|
|
|
int irq;
|
|
|
|
|
2016-01-27 17:54:28 +08:00
|
|
|
struct clk *cmd_clk;
|
|
|
|
struct clk *ref_clk;
|
|
|
|
struct clk *rtc_clk;
|
2016-01-27 17:54:29 +08:00
|
|
|
|
|
|
|
struct reset_control *core_cold_rst;
|
|
|
|
struct reset_control *radio_cold_rst;
|
|
|
|
struct reset_control *radio_warm_rst;
|
|
|
|
struct reset_control *radio_srif_rst;
|
|
|
|
struct reset_control *cpu_init_rst;
|
2016-01-27 17:54:27 +08:00
|
|
|
};
|
|
|
|
|
ath10k: add basic skeleton to support ahb
qca4019 uses ahb instead of pci where it slightly differs in device
enumeration, clock control, reset control, etc. Good thing is that
ahb also uses copy engine for the data transaction. So, the most of
the stuff implemented in pci.c/ce.c are reusable in ahb case too.
Device enumeration in ahb case comes through platform driver/device
model. All resource details like irq, memory map, clocks, etc for
qca4019 can be fetched from of_node of platform device.
Simply flow would look like,
device tree => platform device (kernel) => platform driver (ath10k)
Device tree entry will have all qca4019 resource details and the same
info will be passed to kernel. Kernel will prepare new platform device
for that entry and expose DT info to of_node in platform device.
Later, ath10k would register platform driver with unique compatible name
and then kernels binds to corresponding compatible entry & calls ath10k
ahb probe functions. From there onwards, ath10k will take control of it
and move forward.
New bool flag CONFIG_ATH10K_AHB is added in Kconfig to conditionally
enable ahb support in ath10k. On enabling this flag, ath10k_pci.ko
will have ahb support. This patch adds only basic skeleton and few
macros to support ahb in the context of qca4019.
Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-01-27 17:54:25 +08:00
|
|
|
#ifdef CONFIG_ATH10K_AHB
|
|
|
|
|
2016-01-27 17:54:32 +08:00
|
|
|
#define ATH10K_GCC_REG_BASE 0x1800000
|
|
|
|
#define ATH10K_GCC_REG_SIZE 0x60000
|
|
|
|
|
|
|
|
#define ATH10K_TCSR_REG_BASE 0x1900000
|
|
|
|
#define ATH10K_TCSR_REG_SIZE 0x80000
|
|
|
|
|
2016-01-27 17:54:33 +08:00
|
|
|
#define ATH10K_AHB_GCC_FEPLL_PLL_DIV 0x2f020
|
|
|
|
#define ATH10K_AHB_WIFI_SCRATCH_5_REG 0x4f014
|
|
|
|
|
2016-01-27 17:54:30 +08:00
|
|
|
#define ATH10K_AHB_WLAN_CORE_ID_REG 0x82030
|
|
|
|
|
|
|
|
#define ATH10K_AHB_TCSR_WIFI0_GLB_CFG 0x49000
|
|
|
|
#define ATH10K_AHB_TCSR_WIFI1_GLB_CFG 0x49004
|
|
|
|
#define TCSR_WIFIX_GLB_CFG_DISABLE_CORE_CLK BIT(25)
|
|
|
|
|
|
|
|
#define ATH10K_AHB_TCSR_WCSS0_HALTREQ 0x52000
|
|
|
|
#define ATH10K_AHB_TCSR_WCSS1_HALTREQ 0x52010
|
|
|
|
#define ATH10K_AHB_TCSR_WCSS0_HALTACK 0x52004
|
|
|
|
#define ATH10K_AHB_TCSR_WCSS1_HALTACK 0x52014
|
|
|
|
|
|
|
|
#define ATH10K_AHB_AXI_BUS_HALT_TIMEOUT 10 /* msec */
|
|
|
|
#define AHB_AXI_BUS_HALT_REQ 1
|
|
|
|
#define AHB_AXI_BUS_HALT_ACK 1
|
|
|
|
|
2016-01-27 17:54:33 +08:00
|
|
|
#define ATH10K_AHB_CORE_CTRL_CPU_INTR_MASK 1
|
|
|
|
|
ath10k: add basic skeleton to support ahb
qca4019 uses ahb instead of pci where it slightly differs in device
enumeration, clock control, reset control, etc. Good thing is that
ahb also uses copy engine for the data transaction. So, the most of
the stuff implemented in pci.c/ce.c are reusable in ahb case too.
Device enumeration in ahb case comes through platform driver/device
model. All resource details like irq, memory map, clocks, etc for
qca4019 can be fetched from of_node of platform device.
Simply flow would look like,
device tree => platform device (kernel) => platform driver (ath10k)
Device tree entry will have all qca4019 resource details and the same
info will be passed to kernel. Kernel will prepare new platform device
for that entry and expose DT info to of_node in platform device.
Later, ath10k would register platform driver with unique compatible name
and then kernels binds to corresponding compatible entry & calls ath10k
ahb probe functions. From there onwards, ath10k will take control of it
and move forward.
New bool flag CONFIG_ATH10K_AHB is added in Kconfig to conditionally
enable ahb support in ath10k. On enabling this flag, ath10k_pci.ko
will have ahb support. This patch adds only basic skeleton and few
macros to support ahb in the context of qca4019.
Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-01-27 17:54:25 +08:00
|
|
|
int ath10k_ahb_init(void);
|
|
|
|
void ath10k_ahb_exit(void);
|
|
|
|
|
|
|
|
#else /* CONFIG_ATH10K_AHB */
|
|
|
|
|
|
|
|
static inline int ath10k_ahb_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void ath10k_ahb_exit(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_ATH10K_AHB */
|
|
|
|
|
|
|
|
#endif /* _AHB_H_ */
|