mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
soc: rockchip: tb_service: add memory-no-free property support
Some product scenarios would like the rtos's memory space always been exclusive. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Change-Id: Ib71da6b355995ab5b12ddfdf346bbce8e1852745
This commit is contained in:
@@ -24,6 +24,7 @@ struct rk_tb_serv {
|
||||
struct reset_control *rsts;
|
||||
phys_addr_t mem_start;
|
||||
size_t mem_size;
|
||||
bool mem_no_free;
|
||||
};
|
||||
|
||||
static atomic_t mcu_done = ATOMIC_INIT(0);
|
||||
@@ -89,7 +90,8 @@ static void do_mcu_done(struct rk_tb_serv *serv)
|
||||
|
||||
start = phys_to_virt(serv->mem_start);
|
||||
end = start + serv->mem_size;
|
||||
free_reserved_area(start, end, -1, "rtos");
|
||||
if (!serv->mem_no_free)
|
||||
free_reserved_area(start, end, -1, "rtos");
|
||||
|
||||
spin_lock(&lock);
|
||||
if (atomic_read(&mcu_done)) {
|
||||
@@ -150,6 +152,8 @@ static int rk_tb_serv_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(serv->rsts) && PTR_ERR(serv->rsts) == -EPROBE_DEFER)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
serv->mem_no_free = device_property_read_bool(&pdev->dev, "memory-no-free");
|
||||
|
||||
platform_set_drvdata(pdev, serv);
|
||||
|
||||
mbox_cl = &serv->mbox_cl;
|
||||
|
||||
Reference in New Issue
Block a user