bug235_bringup_0 - Additions and improvements. Support for static videomemory (platsim) added. bug235_bringup_0
authorJani Hyvonen<jani.hyvonen@nokia.com>
Fri, 03 Sep 2010 12:59:30 +0300
branchbug235_bringup_0
changeset 167 b9003303ce25
parent 166 82f54ddc6d9b
child 184 221a1b09860c
bug235_bringup_0 - Additions and improvements. Support for static videomemory (platsim) added.
graphics_plat/guestvideodriver_api/inc/guestvideodriverinterfaceconstants.h
graphics_plat/guestvideodriver_api/ldd/inc/virtualvideohwinterface.h
--- a/graphics_plat/guestvideodriver_api/inc/guestvideodriverinterfaceconstants.h	Thu Sep 02 16:04:46 2010 +0100
+++ b/graphics_plat/guestvideodriver_api/inc/guestvideodriverinterfaceconstants.h	Fri Sep 03 12:59:30 2010 +0300
@@ -20,42 +20,52 @@
 //        pvbus.pvbus_m_range[0x60000000..0x62ffffff] => graphicsvirtualhw.mbus; //=>Reserve own memory area later
 //        pvbus.pvbus_m_range[0x63000000..0x63000fff] => graphicsvirtualhw.pbus; //=>Reserve own memory area later                
 
-#define VVI_REGISTERS_BASE 0x00000000
+#ifdef PLATSIM_CONFIG
+#define VVI_BASE 0x60000000
+#else
+#define VVI_BASE 0x00000000
+#endif // PLATSIM_CONFIG
+
 // base address
-#define VVI_REGISTERS_BASE_ADDRESS 0xC6000000 + 0x10*0x1000 
+#define VVI_REGISTERS_BASE_ADDRESS VVI_BASE + 0x03000000 
 #define VVI_REGISTERS_MEMORY_SIZE 0x1000
 #define VVI_REGISTERS_MASK 0x0FFF
 
-#define VVI_PARAMETERS_INPUT_BASE_ADDRESS VVI_REGISTERS_BASE + 0x00000000
+#define VVI_PARAMETERS_INPUT_BASE_ADDRESS VVI_BASE + 0x00000000
 #define VVI_PARAMETERS_INPUT_MEMORY_SIZE  0x01000000
 
-#define VVI_PARAMETERS_OUTPUT_BASE_ADDRESS VVI_REGISTERS_BASE + 0x01000000
+#define VVI_PARAMETERS_OUTPUT_BASE_ADDRESS VVI_BASE + 0x01000000
 #define VVI_PARAMETERS_OUTPUT_MEMORY_SIZE  0x01000000
 
-#define VVI_FRAMEBUFFER_BASE_ADDRESS VVI_REGISTERS_BASE + 0x02000000
+#define VVI_FRAMEBUFFER_BASE_ADDRESS VVI_BASE + 0x02000000
 #define VVI_FRAMEBUFFER_MEMORY_SIZE  0x01000000
 
 // register indices, TODO: cleanup needed, some are not used
-#define VVI_R_ID                       0x0000
-#define VVI_R_IRQ_ENABLE               0x0004
-#define VVI_R_IRQ_STATUS               0x0008
-#define VVI_R_COMMAND                  0x000c
-#define VVI_R_PARAMETER_LOAD           0x0010
-#define VVI_R_ERROR                    0x0014
-#define VVI_R_INPUT_BUFFER_TAIL        0x0018
-#define VVI_R_INPUT_BUFFER_HEAD        0x001c
-#define VVI_R_INPUT_BUFFER_READ_COUNT  0x0020
-#define VVI_R_INPUT_BUFFER_WRITE_COUNT 0x0024
-#define VVI_R_INPUT_BUFFER_MAX_TAIL    0x0028
-#define VVI_R_REQUEST_ID               0x002c
-#define VVI_R_SHARED_CMD_MEMORY_BASE       0x0030
-#define VVI_R_SHARED_FRAMEBUFFER_MEMORY_BASE 0x0034
-#define VVI_R_LASTREG                  0x0038  // not a register, address of last register
+#define VVI_R_ID                                0x0000
+#define VVI_R_IRQ_ENABLE                        0x0004
+#define VVI_R_IRQ_STATUS                        0x0008
+#define VVI_R_COMMAND                           0x000c
+#define VVI_R_PARAMETER_LOAD                    0x0010
+#define VVI_R_ERROR                             0x0014
+#define VVI_R_INPUT_BUFFER_TAIL                 0x0018
+#define VVI_R_INPUT_BUFFER_HEAD                 0x001c
+#define VVI_R_INPUT_BUFFER_READ_COUNT           0x0020
+#define VVI_R_INPUT_BUFFER_WRITE_COUNT          0x0024
+#define VVI_R_INPUT_BUFFER_MAX_TAIL             0x0028
+#define VVI_R_REQUEST_ID                        0x002c
+#define VVI_R_SHARED_CMD_MEMORY_BASE            0x0030
+#define VVI_R_SHARED_FRAMEBUFFER_MEMORY_BASE    0x0034
+#define VVI_R_LASTREG                           0x0038  // not a register, address of last register
 
 // COMMAND register values
 #define VVI_EXECUTE 0
 
 //IRQ number
-#define VVI_IRQ 11
+#ifdef PLATSIM_CONFIG
+#define VVI_IRQ 391
+#else
+// Jani - This is defined in syborg.h "EIntGraphics" - should we get it from there?
+#define VVI_IRQ 13
+#endif // PLATSIM_CONFIG
 
 #endif
--- a/graphics_plat/guestvideodriver_api/ldd/inc/virtualvideohwinterface.h	Thu Sep 02 16:04:46 2010 +0100
+++ b/graphics_plat/guestvideodriver_api/ldd/inc/virtualvideohwinterface.h	Fri Sep 03 12:59:30 2010 +0300
@@ -27,199 +27,199 @@
 class DVirtualVideoHwInterface : public DBase
     {
     public: // Data types
-	
-	/**
-	 * Enumeration for different interrupts.
-	 */
-	enum TInterrupt
-	    {
-	    EInterruptNewDataAvailable  = 0x01 ///< Video HW has new data available
-	    };
-	/**
-	 * Enumeration for different registers.
-	 */
-	enum TRegister
-	    {
-	    ERegId,			     ///< Id register
-	    ERegIrqEnable,		      ///< IRQ enabling register
-	    ERegIrqStatus,		      ///< IRQ status register
-	    ERegCommand,			///< Command register
-	    ERegParameterLoad,
-	    ERegError,			 ///< 
-	    ERegInputBufferTail,
-	    ERegInputBufferHead,
-	    ERegInputBufferReadCount,
-	    ERegInputBufferWriteCount,
-	    ERegInputBufferMaxTail,
-	    ERegRequestId,
-		ERegSharedCmdMemBase,
-		ERegSharedFramebufferMemBase,
-	    ENumRegisters		       ///< Number of registers						
-	    
-	    };
+    
+    /**
+     * Enumeration for different interrupts.
+     */
+    enum TInterrupt
+        {
+        EInterruptNewDataAvailable  = 0x01 ///< Video HW has new data available
+        };
+    /**
+     * Enumeration for different registers.
+     */
+    enum TRegister
+        {
+        ERegId,              ///< Id register
+        ERegIrqEnable,            ///< IRQ enabling register
+        ERegIrqStatus,            ///< IRQ status register
+        ERegCommand,            ///< Command register
+        ERegParameterLoad,
+        ERegError,           ///< 
+        ERegInputBufferTail,
+        ERegInputBufferHead,
+        ERegInputBufferReadCount,
+        ERegInputBufferWriteCount,
+        ERegInputBufferMaxTail,
+        ERegRequestId,
+        ERegSharedCmdMemBase,
+        ERegSharedFramebufferMemBase,
+        ENumRegisters              ///< Number of registers                     
+        
+        };
 
     public: // Construction and destruction
 
-	/**
-	 * Constructor.
-	 */
-	DVirtualVideoHwInterface();
+    /**
+     * Constructor.
+     */
+    DVirtualVideoHwInterface();
 
-	/**
-	 * Destructor.
-	 * NOTE: Enters and leaves critical section.
-	 */
-	virtual ~DVirtualVideoHwInterface();
+    /**
+     * Destructor.
+     * NOTE: Enters and leaves critical section.
+     */
+    virtual ~DVirtualVideoHwInterface();
 
     public: // Functions
 
 
-	/**
-	 * Initializes the Virtual Video HW's memory mapped I/O model.
-	 * NOTE: Enters and leaves critical section.
-	 *
-	 * @return System-wide error code
-	 */
-	TInt InitParametersInputMemory();
-	TInt InitParametersOutputMemory();
-	
-	/**
-	 * Enables interrupts in the Virtual Video HW.
-	 *
-	 * @param aChannel The channel, whose interrupts are enabled
-	 * @param aInterruptBitField A bitmask of TInterrupt enumeration.
-	 *      Enabled interrupt bits should be set to 1 and disabled interrupt
-	 *      bits to 0.
-	 */
-	void EnableInterrupts( TUint32 aInterruptBitField );
-	
-	/**
-	 * Initializes the Virtual Video HW's memory mapped I/O model.
-	 * NOTE: Enters and leaves critical section.
-	 *
-	 * @return System-wide error code
-	 */
-	 TInt InitRegisterMemory();
-	/**
-	 * Retrieves interrupt enabled state in the Virtual Video HW.
-	 *
-	 * @param aChannel The channel, whose interrupt states are queried
-	 * @param aInterruptBitField A reference parameter, where a bitmask of
-	 *      TInterrupt enumeration will be written. Enabled interrupt bits
-	 *      are set to 1 and disabled interrupt bits to 0.
-	 */
-	void GetInterruptEnabledState( TUint32& aInterruptBitField );
+    /**
+     * Initializes the Virtual Video HW's memory mapped I/O model.
+     * NOTE: Enters and leaves critical section.
+     *
+     * @return System-wide error code
+     */
+    TInt InitParametersInputMemory();
+    TInt InitParametersOutputMemory();
+    
+    /**
+     * Enables interrupts in the Virtual Video HW.
+     *
+     * @param aChannel The channel, whose interrupts are enabled
+     * @param aInterruptBitField A bitmask of TInterrupt enumeration.
+     *      Enabled interrupt bits should be set to 1 and disabled interrupt
+     *      bits to 0.
+     */
+    void EnableInterrupts( TUint32 aInterruptBitField );
+    
+    /**
+     * Initializes the Virtual Video HW's memory mapped I/O model.
+     * NOTE: Enters and leaves critical section.
+     *
+     * @return System-wide error code
+     */
+     TInt InitRegisterMemory();
+    /**
+     * Retrieves interrupt enabled state in the Virtual Video HW.
+     *
+     * @param aChannel The channel, whose interrupt states are queried
+     * @param aInterruptBitField A reference parameter, where a bitmask of
+     *      TInterrupt enumeration will be written. Enabled interrupt bits
+     *      are set to 1 and disabled interrupt bits to 0.
+     */
+    void GetInterruptEnabledState( TUint32& aInterruptBitField );
 
-	/**
-	 * Retrieves interrupt status in the Virtual Video HW.
-	 *
-	 * @param aChannel The channel, whose interrupt status is queried
-	 * @param aInterruptBitField A reference parameter, where a bitmask of
-	 *      TInterrupt enumeration will be written. Those interrupt lines
-	 *      are active, whose bits are set to 1 in the bitmask.
-	 */
-	void GetInterruptStatus( TUint32& aInterruptBitField );
+    /**
+     * Retrieves interrupt status in the Virtual Video HW.
+     *
+     * @param aChannel The channel, whose interrupt status is queried
+     * @param aInterruptBitField A reference parameter, where a bitmask of
+     *      TInterrupt enumeration will be written. Those interrupt lines
+     *      are active, whose bits are set to 1 in the bitmask.
+     */
+    void GetInterruptStatus( TUint32& aInterruptBitField );
 
-	/**
-	 * Resets interrupt status in the Virtual Video HW.
-	 *
-	 * @param aChannel The channel, whose interrupt statuses are being reset
-	 * @param aInterruptBitField The bitmask of TInterrupt enumeration. Those
-	 *      interrupts are reset, whose bits are set to 1 in the bitfield.
-	 */
-	void ResetInterruptStatus( TUint32 aInterruptBitField );
-	
-	/**
-	 * Issues a command to the Virtual Video HW.
-	 *
-	 * @param aCommand One of TCommand enumeration commands.
-	 */
-	void IssueCommand( TUint32 aCommand );
+    /**
+     * Resets interrupt status in the Virtual Video HW.
+     *
+     * @param aChannel The channel, whose interrupt statuses are being reset
+     * @param aInterruptBitField The bitmask of TInterrupt enumeration. Those
+     *      interrupts are reset, whose bits are set to 1 in the bitfield.
+     */
+    void ResetInterruptStatus( TUint32 aInterruptBitField );
+    
+    /**
+     * Issues a command to the Virtual Video HW.
+     *
+     * @param aCommand One of TCommand enumeration commands.
+     */
+    void IssueCommand( TUint32 aCommand );
 
-	/**
-	 * Set shared command memory base address.
-	 *
-	 * @param aPhysicalAddress Physical address of the contiguous memory area reserved for video device.
-	 */
-	void SetSharedCmdMemBase( TUint32 aPhysicalAddress );
-		
-	/**
-	 * Set shared framebuffer memory base address.
-	 *
-	 * @param aPhysicalAddress Physical address of the contiguous memory area reserved for video device.
-	 */
+    /**
+     * Set shared command memory base address.
+     *
+     * @param aPhysicalAddress Physical address of the contiguous memory area reserved for video device.
+     */
+    void SetSharedCmdMemBase( TUint32 aPhysicalAddress );
+        
+    /**
+     * Set shared framebuffer memory base address.
+     *
+     * @param aPhysicalAddress Physical address of the contiguous memory area reserved for video device.
+     */
 
-	void SetSharedFramebufferMemBase( TUint32 aPhysicalAddress );
-	
-	/**
-	 * Address to input parameter buffer
-	 */
-	TLinAddr InputParametersAddress(){ return iInputParametersChunkKernelAddress; }
-	
-	/**
-	 * Address to output parameter buffer
-	 */
-	TLinAddr OutputParametersAddress(){ return iOutputParametersChunkKernelAddress; }
+    void SetSharedFramebufferMemBase( TUint32 aPhysicalAddress );
+    
+    /**
+     * Address to input parameter buffer
+     */
+    TLinAddr InputParametersAddress(){ return iInputParametersChunkKernelAddress; }
+    
+    /**
+     * Address to output parameter buffer
+     */
+    TLinAddr OutputParametersAddress(){ return iOutputParametersChunkKernelAddress; }
 
-	
-	/**
-	 * Gets a register value.
-	 * 
-	 * @param aRegisterRange The register range
-	 * @param aRegister The register in the given register range, whose value is being read
-	 * @param aValue A reference parameter, where the register's value is written
-	 */
-	void GetRegisterValue(
-	    TRegister aRegister,
-	    TUint32& aValue );
+    
+    /**
+     * Gets a register value.
+     * 
+     * @param aRegisterRange The register range
+     * @param aRegister The register in the given register range, whose value is being read
+     * @param aValue A reference parameter, where the register's value is written
+     */
+    void GetRegisterValue(
+        TRegister aRegister,
+        TUint32& aValue );
 
-	/**
-	 * Sets a register value.
-	 * 
-	 * @param aRegisterRange The register range
-	 * @param aRegister The register in the given register range, whose value is being written
-	 * @param aValue A new value to be written into register
-	 */
-	void SetRegisterValue( TRegister aRegister,
-	    TUint32 aValue );
+    /**
+     * Sets a register value.
+     * 
+     * @param aRegisterRange The register range
+     * @param aRegister The register in the given register range, whose value is being written
+     * @param aValue A new value to be written into register
+     */
+    void SetRegisterValue( TRegister aRegister,
+        TUint32 aValue );
 
-	IMPORT_C static TPhysAddr GetFrameBase();
-
-	public:
-        TPhysAddr iFrameRamPhys;
-        static DVirtualVideoHwInterface * pVVHIf;
+    IMPORT_C static TPhysAddr GetFrameBase();
 
     protected:
 
-	/**
-	 * Maps a virtual address range to physical address space
-	 * 
-	 * @param aPhysicalAddress 
-	 * @param aMaxSize 
-	 * @param aChunk
-	 * @param aLinAddr 
-	 * @return System wide error code
-	 */
-	TInt InitPhysicalMemory( TUint32 aPhysicalAddress, 
-		TInt aMaxSize, DChunk*& aChunk, TLinAddr& aLinAddr );
+    /**
+     * Maps a virtual address range to physical address space
+     * 
+     * @param aPhysicalAddress 
+     * @param aMaxSize 
+     * @param aChunk
+     * @param aLinAddr 
+     * @return System wide error code
+     */
+    TInt InitPhysicalMemory( TUint32 aPhysicalAddress, 
+        TInt aMaxSize, DChunk*& aChunk, TLinAddr& aLinAddr );
 
     private: // Data
 
-	/// A memory chunk that is mapped to the Virtual Video HW's physical memory area
-	DChunk* iRegisterMemoryChunk;	
-	/// The virtual start address of the Virtual Video HW's memory map
-	TLinAddr iRegisterChunkKernelAddress;
+    /// A memory chunk that is mapped to the Virtual Video HW's physical memory area
+    DChunk* iRegisterMemoryChunk;   
+    /// The virtual start address of the Virtual Video HW's memory map
+    TLinAddr iRegisterChunkKernelAddress;
+
+    /// A memory chunk that is mapped to the Virtual Video HW's physical memory area
+    DChunk* iInputParametersMemoryChunk;    
+    /// The virtual start address of the Virtual Video HW's memory map
+    TLinAddr iInputParametersChunkKernelAddress;
 
-	/// A memory chunk that is mapped to the Virtual Video HW's physical memory area
-	DChunk* iInputParametersMemoryChunk;	
-	/// The virtual start address of the Virtual Video HW's memory map
-	TLinAddr iInputParametersChunkKernelAddress;
+    /// A memory chunk that is mapped to the Virtual Video HW's physical memory area
+    DChunk* iOutputParametersMemoryChunk;        
+        
+    /// The virtual start address of the Virtual Video HW's memory map
+    TLinAddr iOutputParametersChunkKernelAddress;
+        
+    /// The virtual graphics device physical base address
+    static TPhysAddr iVideoRamBasePhys;
 
-	/// A memory chunk that is mapped to the Virtual Video HW's physical memory area
-	DChunk* iOutputParametersMemoryChunk;	
-	/// The virtual start address of the Virtual Video HW's memory map
-	TLinAddr iOutputParametersChunkKernelAddress;
-    TPhysAddr iVideoRamPhys;
     };