Now that Intel changed the license for the NPE firmware, import it directly
hexed into our tree, instead of requiring the user to download it. Approved by: re (blanket) MFC after: 1 week
This commit is contained in:
parent
857539e578
commit
88af309a0b
@ -104,8 +104,6 @@ device atadisk # ATA disk drives
|
||||
device avila_ata # Gateworks CF/IDE support
|
||||
|
||||
device npe # Network Processing Engine
|
||||
device npe_fw # NPE firmware
|
||||
device firmware # firmware support for npe_fw
|
||||
device qmgr # Q Manager (required by npe)
|
||||
device miibus # NB: required by npe
|
||||
device ether
|
||||
|
25673
sys/arm/xscale/ixp425/IxNpeMicrocode.c
Normal file
25673
sys/arm/xscale/ixp425/IxNpeMicrocode.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -16,34 +16,9 @@ arm/xscale/ixp425/ixp425_a4x_space.c optional uart
|
||||
arm/xscale/ixp425/ixp425_a4x_io.S optional uart
|
||||
dev/uart/uart_dev_ns8250.c optional uart
|
||||
#
|
||||
# NPE-based Ethernet support (requires qmgr also). Note the
|
||||
# firmware images must be downloaded from the Intel web site.
|
||||
# The URL seems to change frequently; try this as a starting
|
||||
# place:
|
||||
#
|
||||
# http://www.intel.com/design/network/products/npfamily/download_ixp400.htm
|
||||
#
|
||||
# NPE-based Ethernet support (requires qmgr also).
|
||||
arm/xscale/ixp425/if_npe.c optional npe
|
||||
arm/xscale/ixp425/ixp425_npe.c optional npe
|
||||
ixp425_npe_fw.c optional npe_fw \
|
||||
compile-with "${AWK} -f $S/tools/fw_stub.awk IxNpeMicrocode.dat:npe_fw -mnpe -c${.TARGET}" \
|
||||
no-implicit-rule before-depend local \
|
||||
clean "ixp425_npe_fw.c"
|
||||
#
|
||||
# NB: ld encodes the path in the binary symbols generated for the
|
||||
# firmware image so link the file to the object directory to
|
||||
# get known values for reference in the _fw.c file.
|
||||
#
|
||||
IxNpeMicrocode.fwo optional npe_fw \
|
||||
dependency "IxNpeMicrocode.dat" \
|
||||
compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} IxNpeMicrocode.dat" \
|
||||
no-implicit-rule \
|
||||
clean "IxNpeMicrocode.fwo"
|
||||
IxNpeMicrocode.dat optional npe_fw \
|
||||
dependency ".PHONY" \
|
||||
compile-with "if [ -e $S/arm/xscale/ixp425/IxNpeMicrocode.dat ]; then ln -sf $S/arm/xscale/ixp425/IxNpeMicrocode.dat .; else echo 'WARNING, no IxNpeMicrocode.dat file; you must obtain this from the Intel web site'; false; fi" \
|
||||
no-obj no-implicit-rule \
|
||||
clean "IxNpeMicrocode.dat"
|
||||
#
|
||||
# Q-Manager support
|
||||
#
|
||||
|
@ -72,10 +72,7 @@ __FBSDID("$FreeBSD$");
|
||||
* The code here basically replaces the npeDl and npeMh classes
|
||||
* in the Intel Access Library (IAL).
|
||||
*
|
||||
* NB: Microcode images are loaded with firmware(9). To
|
||||
* include microcode in a static kernel include the
|
||||
* ixpnpe_fw device. Otherwise the firmware will be
|
||||
* automatically loaded from the filesystem.
|
||||
* NB: Microcode images comes from ixNpeMicrocode.c
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -87,9 +84,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/resource.h>
|
||||
#include <sys/rman.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <sys/linker.h>
|
||||
#include <sys/firmware.h>
|
||||
#include <sys/endian.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/cpu.h>
|
||||
@ -102,6 +97,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include <arm/xscale/ixp425/ixp425_npereg.h>
|
||||
#include <arm/xscale/ixp425/ixp425_npevar.h>
|
||||
|
||||
#include <arm/xscale/ixp425/IxNpeMicrocode.c>
|
||||
|
||||
struct ixpnpe_softc {
|
||||
device_t sc_dev;
|
||||
bus_space_tag_t sc_iot;
|
||||
@ -422,7 +419,6 @@ ixpnpe_init(struct ixpnpe_softc *sc, const char *imageName, uint32_t imageId)
|
||||
{
|
||||
uint32_t imageSize;
|
||||
const uint32_t *imageCodePtr;
|
||||
const struct firmware *fw;
|
||||
int error;
|
||||
|
||||
DPRINTF(sc->sc_dev, "load %s, imageId 0x%08x\n", imageName, imageId);
|
||||
@ -441,12 +437,8 @@ ixpnpe_init(struct ixpnpe_softc *sc, const char *imageName, uint32_t imageId)
|
||||
if (error != 0)
|
||||
return error;
|
||||
|
||||
fw = firmware_get(imageName);
|
||||
if (fw == NULL)
|
||||
return ENOENT;
|
||||
|
||||
/* Locate desired image in files w/ combined images */
|
||||
error = npe_findimage(sc, fw->data, imageId, &imageCodePtr, &imageSize);
|
||||
error = npe_findimage(sc, IxNpeMicrocode_array, imageId,
|
||||
&imageCodePtr, &imageSize);
|
||||
if (error != 0)
|
||||
goto done;
|
||||
|
||||
@ -466,7 +458,6 @@ ixpnpe_init(struct ixpnpe_softc *sc, const char *imageName, uint32_t imageId)
|
||||
sc->functionalityId = IX_NPEDL_FUNCTIONID_FROM_IMAGEID_GET(imageId);
|
||||
mtx_unlock(&sc->sc_mtx);
|
||||
done:
|
||||
firmware_put(fw, FIRMWARE_UNLOAD);
|
||||
DPRINTF(sc->sc_dev, "%s: error %d\n", __func__, error);
|
||||
return error;
|
||||
}
|
||||
@ -510,7 +501,8 @@ npe_load_ins(struct ixpnpe_softc *sc,
|
||||
return EINVAL; /* XXX */
|
||||
}
|
||||
for (i = 0; i < blockSize; i++, npeMemAddress++) {
|
||||
if (npe_ins_write(sc, npeMemAddress, bp->data[i], verify) != 0) {
|
||||
if (npe_ins_write(sc, npeMemAddress, htobe32(bp->data[i]),
|
||||
verify) != 0) {
|
||||
device_printf(sc->sc_dev, "NPE instruction write failed");
|
||||
return EIO;
|
||||
}
|
||||
@ -532,7 +524,8 @@ npe_load_data(struct ixpnpe_softc *sc,
|
||||
return EINVAL;
|
||||
}
|
||||
for (i = 0; i < blockSize; i++, npeMemAddress++) {
|
||||
if (npe_data_write(sc, npeMemAddress, bp->data[i], verify) != 0) {
|
||||
if (npe_data_write(sc, npeMemAddress, htobe32(bp->data[i]), verify)
|
||||
!= 0) {
|
||||
device_printf(sc->sc_dev, "NPE data write failed\n");
|
||||
return EIO;
|
||||
}
|
||||
@ -578,7 +571,7 @@ npe_load_stateinfo(struct ixpnpe_softc *sc,
|
||||
break;
|
||||
}
|
||||
|
||||
if (npe_ctx_reg_write(sc, cNum, reg, regVal, verify) != 0) {
|
||||
if (npe_ctx_reg_write(sc, cNum, reg, htobe32(regVal), verify) != 0) {
|
||||
device_printf(sc->sc_dev, "write of state-info to NPE failed\n");
|
||||
error = EIO;
|
||||
break;
|
||||
|
@ -98,6 +98,14 @@
|
||||
#define IXP425_NPE_B_IMAGEID 0x01000200
|
||||
#define IXP425_NPE_C_IMAGEID 0x02000200
|
||||
|
||||
/* For IxNpeMicrocode.c */
|
||||
#define IX_NPEDL_NPEIMAGE_NPEA_HSS_PORT_0_CHAN_PORT_0_BYPASS_ATM_MPHY_4_PORT
|
||||
#define IX_NPEDL_NPEIMAGE_NPEA_ETH
|
||||
#define IX_NPEDL_NPEIMAGE_NPEA_ETH_HSSCHAN_COEXIST
|
||||
#define IX_NPEDL_NPEIMAGE_NPEA_HSS_2_PORT_CHAN_PORT_0_BYPASS
|
||||
#define IX_NPEDL_NPEIMAGE_NPEB_ETH
|
||||
#define IX_NPEDL_NPEIMAGE_NPEC_ETH
|
||||
|
||||
struct ixpnpe_softc;
|
||||
struct ixpnpe_softc *ixpnpe_attach(device_t);
|
||||
void ixpnpe_detach(struct ixpnpe_softc *);
|
||||
|
Loading…
Reference in New Issue
Block a user