Maurus Cuelenaere | ac67d70 | 2008-05-16 21:16:01 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2008 by Catalin Patulea |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Maurus Cuelenaere | ac67d70 | 2008-05-16 21:16:01 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef IPC_H |
| 23 | #define IPC_H |
| 24 | |
| 25 | /* Inter-Processor Communication */ |
| 26 | |
| 27 | /* Meant to be included by both DSP and ARM code. */ |
| 28 | #ifdef __GNUC__ |
| 29 | /* aligned(2) is VERY IMPORTANT. It ensures gcc generates code with "STRH" |
| 30 | instead of with "STRB". STRB in the DSP memory range is broken because |
| 31 | the HPI is in 16-bit mode. */ |
| 32 | #define PACKED __attribute__((packed)) __attribute__((aligned (2))) |
| 33 | #else |
| 34 | #define PACKED |
| 35 | #endif |
| 36 | |
| 37 | #define PCM_SIZE 32768 /* bytes */ |
| 38 | |
| 39 | struct sdram_buffer { |
| 40 | unsigned long addr; |
| 41 | unsigned short bytes; |
| 42 | } PACKED; |
| 43 | |
| 44 | #define SDRAM_BUFFERS 4 |
| 45 | |
| 46 | struct ipc_message { |
| 47 | unsigned short msg; |
| 48 | union { |
| 49 | #define MSG_INIT 1 |
| 50 | struct msg_init { |
| 51 | unsigned short sdem_addrl; |
| 52 | unsigned short sdem_addrh; |
| 53 | } init PACKED; |
| 54 | #define MSG_DEBUGF 2 |
| 55 | struct { |
| 56 | short buffer[80]; |
| 57 | } debugf PACKED; |
| 58 | #define MSG_REFILL 3 |
| 59 | struct { |
| 60 | unsigned short topbottom; /* byte offset to unlocked half-buffer */ |
| 61 | |
| 62 | unsigned short _DMA_TRG; |
| 63 | unsigned short _SDEM_ADDRH; |
| 64 | unsigned short _SDEM_ADDRL; |
| 65 | unsigned short _DSP_ADDRH; |
| 66 | unsigned short _DSP_ADDRL; |
| 67 | unsigned short _DMA_SIZE; |
| 68 | } refill PACKED; |
| 69 | } payload PACKED; |
| 70 | } PACKED; |
| 71 | #endif |