Path: blob/master/drivers/media/video/cx18/cx18-scb.h
17768 views
/*1* cx18 System Control Block initialization2*3* Copyright (C) 2007 Hans Verkuil <[email protected]>4* Copyright (C) 2008 Andy Walls <[email protected]>5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License as published by8* the Free Software Foundation; either version 2 of the License, or9* (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program; if not, write to the Free Software18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA19* 02111-1307 USA20*/2122#ifndef CX18_SCB_H23#define CX18_SCB_H2425#include "cx18-mailbox.h"2627/* NOTE: All ACK interrupts are in the SW2 register. All non-ACK interrupts28are in the SW1 register. */2930#define IRQ_APU_TO_CPU 0x0000000131#define IRQ_CPU_TO_APU_ACK 0x0000000132#define IRQ_HPU_TO_CPU 0x0000000233#define IRQ_CPU_TO_HPU_ACK 0x0000000234#define IRQ_PPU_TO_CPU 0x0000000435#define IRQ_CPU_TO_PPU_ACK 0x0000000436#define IRQ_EPU_TO_CPU 0x0000000837#define IRQ_CPU_TO_EPU_ACK 0x000000083839#define IRQ_CPU_TO_APU 0x0000001040#define IRQ_APU_TO_CPU_ACK 0x0000001041#define IRQ_HPU_TO_APU 0x0000002042#define IRQ_APU_TO_HPU_ACK 0x0000002043#define IRQ_PPU_TO_APU 0x0000004044#define IRQ_APU_TO_PPU_ACK 0x0000004045#define IRQ_EPU_TO_APU 0x0000008046#define IRQ_APU_TO_EPU_ACK 0x000000804748#define IRQ_CPU_TO_HPU 0x0000010049#define IRQ_HPU_TO_CPU_ACK 0x0000010050#define IRQ_APU_TO_HPU 0x0000020051#define IRQ_HPU_TO_APU_ACK 0x0000020052#define IRQ_PPU_TO_HPU 0x0000040053#define IRQ_HPU_TO_PPU_ACK 0x0000040054#define IRQ_EPU_TO_HPU 0x0000080055#define IRQ_HPU_TO_EPU_ACK 0x000008005657#define IRQ_CPU_TO_PPU 0x0000100058#define IRQ_PPU_TO_CPU_ACK 0x0000100059#define IRQ_APU_TO_PPU 0x0000200060#define IRQ_PPU_TO_APU_ACK 0x0000200061#define IRQ_HPU_TO_PPU 0x0000400062#define IRQ_PPU_TO_HPU_ACK 0x0000400063#define IRQ_EPU_TO_PPU 0x0000800064#define IRQ_PPU_TO_EPU_ACK 0x000080006566#define IRQ_CPU_TO_EPU 0x0001000067#define IRQ_EPU_TO_CPU_ACK 0x0001000068#define IRQ_APU_TO_EPU 0x0002000069#define IRQ_EPU_TO_APU_ACK 0x0002000070#define IRQ_HPU_TO_EPU 0x0004000071#define IRQ_EPU_TO_HPU_ACK 0x0004000072#define IRQ_PPU_TO_EPU 0x0008000073#define IRQ_EPU_TO_PPU_ACK 0x000800007475#define SCB_OFFSET 0xDC00007677/* If Firmware uses fixed memory map, it shall not allocate the area78between SCB_OFFSET and SCB_OFFSET+SCB_RESERVED_SIZE-1 inclusive */79#define SCB_RESERVED_SIZE 0x10000808182/* This structure is used by EPU to provide memory descriptors in its memory */83struct cx18_mdl_ent {84u32 paddr; /* Physical address of a buffer segment */85u32 length; /* Length of the buffer segment */86};8788struct cx18_scb {89/* These fields form the System Control Block which is used at boot time90for localizing the IPC data as well as the code positions for all91processors. The offsets are from the start of this struct. */9293/* Offset where to find the Inter-Processor Communication data */94u32 ipc_offset;95u32 reserved01[7];96/* Offset where to find the start of the CPU code */97u32 cpu_code_offset;98u32 reserved02[3];99/* Offset where to find the start of the APU code */100u32 apu_code_offset;101u32 reserved03[3];102/* Offset where to find the start of the HPU code */103u32 hpu_code_offset;104u32 reserved04[3];105/* Offset where to find the start of the PPU code */106u32 ppu_code_offset;107u32 reserved05[3];108109/* These fields form Inter-Processor Communication data which is used110by all processors to locate the information needed for communicating111with other processors */112113/* Fields for CPU: */114115/* bit 0: 1/0 processor ready/not ready. Set other bits to 0. */116u32 cpu_state;117u32 reserved1[7];118/* Offset to the mailbox used for sending commands from APU to CPU */119u32 apu2cpu_mb_offset;120/* Value to write to register SW1 register set (0xC7003100) after the121command is ready */122u32 apu2cpu_irq;123/* Value to write to register SW2 register set (0xC7003140) after the124command is cleared */125u32 cpu2apu_irq_ack;126u32 reserved2[13];127128u32 hpu2cpu_mb_offset;129u32 hpu2cpu_irq;130u32 cpu2hpu_irq_ack;131u32 reserved3[13];132133u32 ppu2cpu_mb_offset;134u32 ppu2cpu_irq;135u32 cpu2ppu_irq_ack;136u32 reserved4[13];137138u32 epu2cpu_mb_offset;139u32 epu2cpu_irq;140u32 cpu2epu_irq_ack;141u32 reserved5[13];142u32 reserved6[8];143144/* Fields for APU: */145146u32 apu_state;147u32 reserved11[7];148u32 cpu2apu_mb_offset;149u32 cpu2apu_irq;150u32 apu2cpu_irq_ack;151u32 reserved12[13];152153u32 hpu2apu_mb_offset;154u32 hpu2apu_irq;155u32 apu2hpu_irq_ack;156u32 reserved13[13];157158u32 ppu2apu_mb_offset;159u32 ppu2apu_irq;160u32 apu2ppu_irq_ack;161u32 reserved14[13];162163u32 epu2apu_mb_offset;164u32 epu2apu_irq;165u32 apu2epu_irq_ack;166u32 reserved15[13];167u32 reserved16[8];168169/* Fields for HPU: */170171u32 hpu_state;172u32 reserved21[7];173u32 cpu2hpu_mb_offset;174u32 cpu2hpu_irq;175u32 hpu2cpu_irq_ack;176u32 reserved22[13];177178u32 apu2hpu_mb_offset;179u32 apu2hpu_irq;180u32 hpu2apu_irq_ack;181u32 reserved23[13];182183u32 ppu2hpu_mb_offset;184u32 ppu2hpu_irq;185u32 hpu2ppu_irq_ack;186u32 reserved24[13];187188u32 epu2hpu_mb_offset;189u32 epu2hpu_irq;190u32 hpu2epu_irq_ack;191u32 reserved25[13];192u32 reserved26[8];193194/* Fields for PPU: */195196u32 ppu_state;197u32 reserved31[7];198u32 cpu2ppu_mb_offset;199u32 cpu2ppu_irq;200u32 ppu2cpu_irq_ack;201u32 reserved32[13];202203u32 apu2ppu_mb_offset;204u32 apu2ppu_irq;205u32 ppu2apu_irq_ack;206u32 reserved33[13];207208u32 hpu2ppu_mb_offset;209u32 hpu2ppu_irq;210u32 ppu2hpu_irq_ack;211u32 reserved34[13];212213u32 epu2ppu_mb_offset;214u32 epu2ppu_irq;215u32 ppu2epu_irq_ack;216u32 reserved35[13];217u32 reserved36[8];218219/* Fields for EPU: */220221u32 epu_state;222u32 reserved41[7];223u32 cpu2epu_mb_offset;224u32 cpu2epu_irq;225u32 epu2cpu_irq_ack;226u32 reserved42[13];227228u32 apu2epu_mb_offset;229u32 apu2epu_irq;230u32 epu2apu_irq_ack;231u32 reserved43[13];232233u32 hpu2epu_mb_offset;234u32 hpu2epu_irq;235u32 epu2hpu_irq_ack;236u32 reserved44[13];237238u32 ppu2epu_mb_offset;239u32 ppu2epu_irq;240u32 epu2ppu_irq_ack;241u32 reserved45[13];242u32 reserved46[8];243244u32 semaphores[8]; /* Semaphores */245246u32 reserved50[32]; /* Reserved for future use */247248struct cx18_mailbox apu2cpu_mb;249struct cx18_mailbox hpu2cpu_mb;250struct cx18_mailbox ppu2cpu_mb;251struct cx18_mailbox epu2cpu_mb;252253struct cx18_mailbox cpu2apu_mb;254struct cx18_mailbox hpu2apu_mb;255struct cx18_mailbox ppu2apu_mb;256struct cx18_mailbox epu2apu_mb;257258struct cx18_mailbox cpu2hpu_mb;259struct cx18_mailbox apu2hpu_mb;260struct cx18_mailbox ppu2hpu_mb;261struct cx18_mailbox epu2hpu_mb;262263struct cx18_mailbox cpu2ppu_mb;264struct cx18_mailbox apu2ppu_mb;265struct cx18_mailbox hpu2ppu_mb;266struct cx18_mailbox epu2ppu_mb;267268struct cx18_mailbox cpu2epu_mb;269struct cx18_mailbox apu2epu_mb;270struct cx18_mailbox hpu2epu_mb;271struct cx18_mailbox ppu2epu_mb;272273struct cx18_mdl_ack cpu_mdl_ack[CX18_MAX_STREAMS][CX18_MAX_MDL_ACKS];274struct cx18_mdl_ent cpu_mdl[1];275};276277void cx18_init_scb(struct cx18 *cx);278279#endif280281282