1. 19 10月, 2009 6 次提交
    • I
      wimax/i2400m: retry loading firmware files in sequence · ebc5f62b
      Inaky Perez-Gonzalez 提交于
      The i2400m firmware loader is given a list of firmware files to try to
      load by the probe() function (which can be different based on the
      device's model / generation).
      
      Current code didn't attempt to load, check and try to boot with each
      file, but just to try to load if off disk. This is limiting in some
      cases, where we might want to try to load a firmware and if it fails
      to load onto the device, just fall back to another one.
      
      This changes the behaviour so all files are tried for being loaded
      from disk, checked and uploaded to the device until one suceeds in
      bringing the device up.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      ebc5f62b
    • I
      wimax/i2400m: rework bootrom initialization to be more flexible · aba3792a
      Inaky Perez-Gonzalez 提交于
      This modifies the bootrom initialization code of the i2400m driver so
      it can more easily support upcoming hardware.
      
      Currently, the code detects two types of barkers (magic numbers) sent
      by the device to indicate the types of firmware it would take (signed
      vs non-signed).
      
      This schema is extended so that multiple reboot barkers are
      recognized; upcoming hw will expose more types barkers which will have
      to match a header in the firmware image before we can load it.
      
      For that, a barker database is introduced; the first time the device
      sends a barker, it is matched in the database. That gives the driver
      the information needed to decide how to upload the firmware and which
      types of firmware to use. The database can be populated from module
      parameters.
      
      The execution flow is not altered; a new function
      (i2400m_is_boot_barker) is introduced to determine in the RX path if
      the device has sent a boot barker. This function is becoming heavier,
      so it is put away from the hot reception path [this is why there is
      some reorganization in sdio-rx.c:i2400ms_rx and
      usb-notifc.c:i2400mu_notification_grok()].
      
      The documentation on the process has also been updated.
      
      All these modifications are heavily based on previous work by Dirk
      Brandewie <dirk.brandewie@intel.com>.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      aba3792a
    • I
      wimax/i2400m: decide properly if using signed vs non-signed firmware loading · 32742e61
      Inaky Perez-Gonzalez 提交于
      The i2400m based devices can boot two main types of firmware images:
      signed and non-signed. Signed images have signature data included that
      must match that of a certificate stored in the device.
      
      Currently the code is making the decission on what type of firmware
      load (signed vs non-signed) is going to be loaded based on a hardcoded
      decission in __i2400m_ack_verify(), based on the barker the device
      sent upon boot.
      
      This is not flexible enough as future hardware will emit more barkers;
      thus the bit has to be set in a place where there is better knowledge
      of what is going on. This will be done in follow-up commits -- however
      this patch paves the way for it.
      
      So the querying of the mode is packed into i2400m_boot_is_signed();
      the main changes are just using i2400m_boot_is_signed() to determine
      the method to follow and setting i2400m->sboot in
      i2400m_is_boot_barker(). The modifications in i2400m_dnload_init() and
      i2400m_dnload_finalize() are just reorganizing the order of the if
      blocks and thus look larger than they really are.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      32742e61
    • C
      wimax/i2400m: don't write to memory allocated by request_firmware() · 8d8fe198
      Cindy H Kao 提交于
      In kernel 2.6.31, the firmware requested to ram could be marked
      with read only attribute, and we can't write any thing directly
      to the memory when setting up the last JUMP brh cmd.
      
      Changed so that the scratch buffer is used.
      Signed-off-by: NCindy H Kao <cindy.h.kao@intel.com>
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      8d8fe198
    • I
      wimax/i2400m: be smarter about copying command buffer to bm_cmd_buf · 77e1251a
      Inaky Perez-Gonzalez 提交于
      Because some underlying bus APIs (like USB) don't like data buffers in
      the stack or vmalloced areas, the i2400m driver provides a scratch
      buffer (i2400m->bm_cmd_buf) for said low-level drivers to copy command
      data to before passing it to said API. This is only used during boot
      mode.
      
      However, at some the code was copying the buffer even when the command
      was already specified in said buffer. This is ok, but it needs to be
      more careful. As thus, change so that:
      
      (a) the copy happens only if command buffer is not the scratch buffer
      
      (b) use memmove() in case there is overlapping
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      77e1251a
    • D
      wimax/i2400m: Make boot retries a BUS-specific parameter · c3083658
      Dirk Brandewie 提交于
      In i2400m-based devices, the driver's bootloader will retry to load
      the firmware when things go wrong. The driver currently has a constant
      (I2400M_BOOT_RETRIES) which governs the max number of tries.
      
      However, different SKUs of the same hardware may admit or require
      different numbers of retries due to it's particulars, so it is made a
      BUS specific parameter and different values are assigned for 5x50
      devices versus the 3200 ones.
      Signed-off-by: NDirk Brandewie <dirk.j.brandewie@intel.com>
      Signed-off-by: NCindy H Kao <cindy.h.kao@intel.com>
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      c3083658
  2. 11 6月, 2009 6 次提交
  3. 02 3月, 2009 1 次提交
    • I
      wimax/i2400m: add the ability to fallback to other firmware files if the default is not there · 1039abbc
      Inaky Perez-Gonzalez 提交于
      In order to support backwards compatibility with older firmwares when
      a driver is updated by a new kernel release, the i2400m bus drivers
      can declare a list of firmware files they can work with (in general
      these will be each a different version). The firmware loader will try
      them in sequence until one loads.
      
      Thus, if a user doesn't have the latest and greatest firmware that a
      newly installed kernel would require, the driver would fall back to
      the firmware from a previous release.
      
      To support this, the i2400m->bus_fw_name is changed to be a NULL
      terminated array firmware file names (and renamed to bus_fw_names) and
      we add a new entry (i2400m->fw_name) that points to the name of the
      firmware being currently used. All code that needs to print the
      firmware file name uses i2400m->fw_name instead of the old
      i2400m->bus_fw_name.
      
      The code in i2400m_dev_bootstrap() that loads the firmware is changed
      with an iterator over the firmware file name list that tries to load
      each form user space, using the first one that succeeds in
      request_firmware() (and thus stopping the iteration).
      
      The USB and SDIO bus drivers are updated to take advantage of this and
      reflect which firmwares they support.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1039abbc
  4. 01 2月, 2009 1 次提交
  5. 08 1月, 2009 1 次提交