Re: [PATCH v7] qe: add ability to upload QE firmware

2008-01-17 Thread Kumar Gala
On Tue, 8 Jan 2008, Timur Tabi wrote:

 Define the layout of a binary blob that contains a QE firmware and 
 instructions
 on how to upload it.  Add function qe_upload_firmware() to parse the blob
 and perform the actual upload.  Fully define 'struct rsp' in immap_qe.h to
 include the actual RISC Special Registers.  Added description of a new
 QE firmware node to booting-without-of.txt.

 Signed-off-by: Timur Tabi [EMAIL PROTECTED]
 ---

 Updated w.r.t. comments from Stephen R.

 This patch is for Kumar's for-2.6.25 branch.  This code is necessary for
 my QE UART driver.

  Documentation/powerpc/00-INDEX   |3 +
  Documentation/powerpc/booting-without-of.txt |   33 +++-
  Documentation/powerpc/qe_firmware.txt|  295 
 ++
  arch/powerpc/platforms/Kconfig   |1 +
  arch/powerpc/sysdev/qe_lib/qe.c  |  247 +
  include/asm-powerpc/immap_qe.h   |   34 +++-
  include/asm-powerpc/qe.h |   61 ++
  7 files changed, 670 insertions(+), 4 deletions(-)
  create mode 100644 Documentation/powerpc/qe_firmware.txt


applied.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v7] qe: add ability to upload QE firmware

2008-01-08 Thread Timur Tabi
Define the layout of a binary blob that contains a QE firmware and instructions
on how to upload it.  Add function qe_upload_firmware() to parse the blob
and perform the actual upload.  Fully define 'struct rsp' in immap_qe.h to
include the actual RISC Special Registers.  Added description of a new
QE firmware node to booting-without-of.txt.

Signed-off-by: Timur Tabi [EMAIL PROTECTED]
---

Updated w.r.t. comments from Stephen R.

This patch is for Kumar's for-2.6.25 branch.  This code is necessary for
my QE UART driver.

 Documentation/powerpc/00-INDEX   |3 +
 Documentation/powerpc/booting-without-of.txt |   33 +++-
 Documentation/powerpc/qe_firmware.txt|  295 ++
 arch/powerpc/platforms/Kconfig   |1 +
 arch/powerpc/sysdev/qe_lib/qe.c  |  247 +
 include/asm-powerpc/immap_qe.h   |   34 +++-
 include/asm-powerpc/qe.h |   61 ++
 7 files changed, 670 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/powerpc/qe_firmware.txt

diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX
index 94a3c57..3be84aa 100644
--- a/Documentation/powerpc/00-INDEX
+++ b/Documentation/powerpc/00-INDEX
@@ -28,3 +28,6 @@ sound.txt
- info on sound support under Linux/PPC
 zImage_layout.txt
- info on the kernel images for Linux/PPC
+qe_firmware.txt
+   - describes the layout of firmware binaries for the Freescale QUICC
+ Engine and the code that parses and uploads the microcode therein.
diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index ee0209a..53c2295 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -52,7 +52,10 @@ Table of Contents
   i) Freescale QUICC Engine module (QE)
   j) CFI or JEDEC memory-mapped NOR flash
   k) Global Utilities Block
-  l) Xilinx IP cores
+  l) Freescale Communications Processor Module
+  m) Chipselect/Local Bus
+  n) 4xx/Axon EMAC ethernet nodes
+  o) Xilinx IP cores
 
   VII - Specifying interrupt information for devices
 1) interrupts property
@@ -1788,6 +1791,32 @@ platforms are moved over to use the 
flattened-device-tree model.
};
};
 
+   viii) Uploaded QE firmware
+
+If a new firwmare has been uploaded to the QE (usually by the
+boot loader), then a 'firmware' child node should be added to the QE
+node.  This node provides information on the uploaded firmware that
+device drivers may need.
+
+Required properties:
+- id: The string name of the firmware.  This is taken from the 'id'
+  member of the qe_firmware structure of the uploaded firmware.
+  Device drivers can search this string to determine if the
+  firmware they want is already present.
+- extended-modes: The Extended Modes bitfield, taken from the
+  firmware binary.  It is a 64-bit number represented
+  as an array of two 32-bit numbers.
+- virtual-traps: The virtual traps, taken from the firmware binary.
+ It is an array of 8 32-bit numbers.
+
+Example:
+
+   firmware {
+   id = Soft-UART;
+   extended-modes = 0 0;
+   virtual-traps = 0 0 0 0 0 0 0 0;
+   }
+
j) CFI or JEDEC memory-mapped NOR flash
 
 Flash chips (Memory Technology Devices) are often used for solid state
@@ -2270,7 +2299,7 @@ platforms are moved over to use the flattened-device-tree 
model.
   available.
   For Axon: 0x012a
 
-   l) Xilinx IP cores
+   o) Xilinx IP cores
 
The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
diff --git a/Documentation/powerpc/qe_firmware.txt 
b/Documentation/powerpc/qe_firmware.txt
new file mode 100644
index 000..8962664
--- /dev/null
+++ b/Documentation/powerpc/qe_firmware.txt
@@ -0,0 +1,295 @@
+  Freescale QUICC Engine Firmware Uploading
+  -
+
+(c) 2007 Timur Tabi timur at freescale.com,
+Freescale Semiconductor
+
+Table of Contents
+=
+
+  I - Software License for Firmware
+
+  II - Microcode Availability
+
+  III - Description and Terminology
+
+  IV - Microcode Programming Details
+
+  V - Firmware Structure Layout
+
+  VI - Sample Code for Creating Firmware Files
+
+Revision Information
+
+
+November 30, 2007: Rev 1.0 - Initial version
+
+I - Software License for Firmware
+=
+
+Each firmware file comes with its own software license.  For information on
+the particular license, please see the license text that is