162306a36Sopenharmony_ci/* SPDX-License-Identifier: ISC */
262306a36Sopenharmony_ci/* Copyright (c) 2015 Qualcomm Atheros, Inc.
362306a36Sopenharmony_ci * Copyright (c) 2018, The Linux Foundation. All rights reserved.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci/* This file contains the definitions for the boot loader
762306a36Sopenharmony_ci * for the Qualcomm "Sparrow" 60 Gigabit wireless solution.
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci#ifndef BOOT_LOADER_EXPORT_H_
1062306a36Sopenharmony_ci#define BOOT_LOADER_EXPORT_H_
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cistruct bl_dedicated_registers_v1 {
1362306a36Sopenharmony_ci	__le32	boot_loader_ready;		/* 0x880A3C driver will poll
1462306a36Sopenharmony_ci						 * this Dword until BL will
1562306a36Sopenharmony_ci						 * set it to 1 (initial value
1662306a36Sopenharmony_ci						 * should be 0)
1762306a36Sopenharmony_ci						 */
1862306a36Sopenharmony_ci	__le32	boot_loader_struct_version;	/* 0x880A40 BL struct ver. */
1962306a36Sopenharmony_ci	__le16	rf_type;			/* 0x880A44 connected RF ID */
2062306a36Sopenharmony_ci	__le16	rf_status;			/* 0x880A46 RF status,
2162306a36Sopenharmony_ci						 * 0 is OK else error
2262306a36Sopenharmony_ci						 */
2362306a36Sopenharmony_ci	__le32	baseband_type;			/* 0x880A48 board type ID */
2462306a36Sopenharmony_ci	u8	mac_address[6];			/* 0x880A4c BL mac address */
2562306a36Sopenharmony_ci	u8	bl_version_major;		/* 0x880A52 BL ver. major */
2662306a36Sopenharmony_ci	u8	bl_version_minor;		/* 0x880A53 BL ver. minor */
2762306a36Sopenharmony_ci	__le16	bl_version_subminor;		/* 0x880A54 BL ver. subminor */
2862306a36Sopenharmony_ci	__le16	bl_version_build;		/* 0x880A56 BL ver. build */
2962306a36Sopenharmony_ci	/* valid only for version 2 and above */
3062306a36Sopenharmony_ci	__le32  bl_assert_code;         /* 0x880A58 BL Assert code */
3162306a36Sopenharmony_ci	__le32  bl_assert_blink;        /* 0x880A5C BL Assert Branch */
3262306a36Sopenharmony_ci	__le32  bl_shutdown_handshake;  /* 0x880A60 BL cleaner shutdown */
3362306a36Sopenharmony_ci	__le32  bl_reserved[21];        /* 0x880A64 - 0x880AB4 */
3462306a36Sopenharmony_ci	__le32  bl_magic_number;        /* 0x880AB8 BL Magic number */
3562306a36Sopenharmony_ci} __packed;
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/* the following struct is the version 0 struct */
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_cistruct bl_dedicated_registers_v0 {
4062306a36Sopenharmony_ci	__le32	boot_loader_ready;		/* 0x880A3C driver will poll
4162306a36Sopenharmony_ci						 * this Dword until BL will
4262306a36Sopenharmony_ci						 * set it to 1 (initial value
4362306a36Sopenharmony_ci						 * should be 0)
4462306a36Sopenharmony_ci						 */
4562306a36Sopenharmony_ci#define BL_READY (1)	/* ready indication */
4662306a36Sopenharmony_ci	__le32	boot_loader_struct_version;	/* 0x880A40 BL struct ver. */
4762306a36Sopenharmony_ci	__le32	rf_type;			/* 0x880A44 connected RF ID */
4862306a36Sopenharmony_ci	__le32	baseband_type;			/* 0x880A48 board type ID */
4962306a36Sopenharmony_ci	u8	mac_address[6];			/* 0x880A4c BL mac address */
5062306a36Sopenharmony_ci} __packed;
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci/* bits for bl_shutdown_handshake */
5362306a36Sopenharmony_ci#define BL_SHUTDOWN_HS_GRTD		BIT(0)
5462306a36Sopenharmony_ci#define BL_SHUTDOWN_HS_RTD		BIT(1)
5562306a36Sopenharmony_ci#define BL_SHUTDOWN_HS_PROT_VER(x) WIL_GET_BITS(x, 28, 31)
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci#endif /* BOOT_LOADER_EXPORT_H_ */
58