BG is a companion chip for msm8909 for low power needs.
Add BG PIL driver to provide load, subsystem restart
and ramdump collection support.
The driver loads the BG firmware into memory and sends
a command to the secure userspace application to initiate
secure transfer of the BG firmware into internal memory
of BG and reset BG. The subsystem restart depends on four
GPIOs present between MSM8909 and BG.
Snapshot of BG PIL and feature drivers taken from msm-3.18
kernel version@ commit 5554caa9f538fe ("soc: qcom: Add
Blackghost(BG) chip PIL driver")
Change-Id: Ica6fa7a7df94a869ff09a1697ea04ee65afbd501
Signed-off-by: Ramesh Yadav Javadi <javadi@codeaurora.org>
64 lines
1.7 KiB
C
64 lines
1.7 KiB
C
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
* only version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
#ifndef LINUX_BG_CHAR_H
|
|
#define LINUX_BG_CHAR_H
|
|
#define BGCOM_REG_READ 0
|
|
#define BGCOM_AHB_READ 1
|
|
#define BGCOM_AHB_WRITE 2
|
|
#define BGCOM_SET_SPI_FREE 3
|
|
#define BGCOM_SET_SPI_BUSY 4
|
|
#define BGCOM_REG_WRITE 5
|
|
#define BGCOM_SOFT_RESET 6
|
|
#define BGCOM_MODEM_DOWN2_BG 7
|
|
#define EXCHANGE_CODE 'V'
|
|
|
|
struct bg_ui_data {
|
|
uint64_t __user write;
|
|
uint64_t __user result;
|
|
uint32_t bg_address;
|
|
uint32_t cmd;
|
|
uint32_t num_of_words;
|
|
};
|
|
|
|
enum bg_event_type {
|
|
BG_BEFORE_POWER_DOWN = 1,
|
|
BG_AFTER_POWER_UP,
|
|
MODEM_BEFORE_POWER_DOWN,
|
|
MODEM_AFTER_POWER_UP,
|
|
};
|
|
|
|
#define REG_READ \
|
|
_IOWR(EXCHANGE_CODE, BGCOM_REG_READ, \
|
|
struct bg_ui_data)
|
|
#define AHB_READ \
|
|
_IOWR(EXCHANGE_CODE, BGCOM_AHB_READ, \
|
|
struct bg_ui_data)
|
|
#define AHB_WRITE \
|
|
_IOW(EXCHANGE_CODE, BGCOM_AHB_WRITE, \
|
|
struct bg_ui_data)
|
|
#define SET_SPI_FREE \
|
|
_IOR(EXCHANGE_CODE, BGCOM_SET_SPI_FREE, \
|
|
struct bg_ui_data)
|
|
#define SET_SPI_BUSY \
|
|
_IOR(EXCHANGE_CODE, BGCOM_SET_SPI_BUSY, \
|
|
struct bg_ui_data)
|
|
#define REG_WRITE \
|
|
_IOWR(EXCHANGE_CODE, BGCOM_REG_WRITE, \
|
|
struct bg_ui_data)
|
|
#define BG_SOFT_RESET \
|
|
_IOWR(EXCHANGE_CODE, BGCOM_SOFT_RESET, \
|
|
struct bg_ui_data)
|
|
#define BG_MODEM_DOWN2_BG_DONE \
|
|
_IOWR(EXCHANGE_CODE, BGCOM_MODEM_DOWN2_BG, \
|
|
struct bg_ui_data)
|
|
#endif
|