Commit Graph

725 Commits

Author SHA1 Message Date
Avik Sil 46d3927f7a Remove lodable network driver modules and related functions
All network drivers have been moved to library

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:00:47 +05:30
Avik Sil 5f84bfe465 Add bcm57xx network driver in libbcm
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:00:28 +05:30
Avik Sil 9c928cc428 Add e1000 network driver in libe1k
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:00:18 +05:30
Avik Sil 46a32aa9c7 Add virtio-net driver in libvirtio
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:00:13 +05:30
Avik Sil eb5994df20 Add veth driver in libveth
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:00:06 +05:30
Avik Sil 16e4888783 Get MAC address for client interface module
The network drivers ported to library get interfaced with net-snk
through client interface module. Hence the ci module should set
the MAC address during initialization.

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 11:59:59 +05:30
Avik Sil 5046c29b5c Add SLOF usleep wrapper
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 11:59:33 +05:30
Avik Sil 89dee020cf Add SLOF pci wrapper functions
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 11:58:51 +05:30
Avik Sil 43ba6e5c7f Fix 'canon' client interface
As per 1275 standard, canon converts the possibly ambiguous
device-specifier to a fully qualified pathname (see 6.3.2.2). It is kind
of find-alias for clients. Earlier canon implementation was not complete,
it was not at all returning the full path name. So grub was not getting
the alias path by calling canon and it was breaking.

In this patch I'm checking if the passed string is already a full path
by comparing the first character with '/'. In that case I return the
passed string as is. Otherwise I return the find-alias.

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-09-26 16:25:43 +05:30
Nikunj A Dadhania a523d1b0cd usb-ohci: Convert td-phys every time to td-virt
next_td is phys pointer as well, convert that to virt

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-23 16:25:49 +05:30
Nikunj A Dadhania 9545b3dc96 usb-storage: Fix cbwflags field
SCSI layer represents DIR as TRUE or FALSE, and for SLOF TRUE is -1
and FALSE is 0, convert that to proper direction when building the
CBW

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-23 16:00:09 +05:30
Nikunj A Dadhania 7eca6a5e56 Add -fno-strict-aliasing in global CFLAGS
This solves the bad checksum issue in udp header. The fill_udp_checksum()
function suffers from "strict aliasing" problem as it is doing quite a bit
of pointer casting.

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-23 10:47:42 +05:30
Nikunj A Dadhania 1abf624dfb usb: fix various issues found with js2x
* JS20 exposed various timing related issues that were not apparent in
  the emulated environment.
* Reset the USB Bus
* JS20 overrides the frame_interval and periodic_start on setting the
  controller to USB operational. Reprogram them.
* ohci fix the data-toggle bits.
* Robust error handling

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:50:02 +05:30
Nikunj A Dadhania 85b0956ddb Move hex64-{decode,encode}-unit to node.fs
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:49:58 +05:30
Nikunj A Dadhania 5a75cd882e usb: Use separate in-memory endian swap
Convert pending in-memory byteswaps to accessors

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:49:41 +05:30
Nikunj A Dadhania 8092c2e3e3 usb-ohci: collect TDs from done list
OHCI HC after using the TDs queues them back to hccaDoneHead. Until
this event the TDs cannot be reused, as there might be references in
the host controller still pending. Recycle all the TDs from the queue
and acknowledge it by clearing the WD bit in interrupt status
register.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:49:36 +05:30
Nikunj A Dadhania a481b1d18a js2x: more fixes
* Build fixes to include scsi files
* Move usb-setup-hcidev out of board-qemu
* Fix pci-bridge-probe to assign temporary ranges

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:49:32 +05:30
Benjamin Herrenschmidt 62cf23bf89 js2x: Fix build of takeover image
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 18:18:57 +10:00
Nikunj A Dadhania ad2060c3d7 js2x: use new usb stack
Fix the js2x build to compile and link the usb stack.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06 11:50:19 +05:30
Benjamin Herrenschmidt 77107650e8 usb-ohci: Use proper memory barriers always
Compiler barriers are not useful for ordering memory
accesses.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:05:38 +10:00
Benjamin Herrenschmidt fa6de662a9 usb: Fix a couple of warnings
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:03:55 +10:00
Benjamin Herrenschmidt 4bb998db00 Fix $cat-instance-unit
We were incorrectly checking ig instance>#units was 0 (forgot to
actually load the value before testing it) and then didn't properly
fallback to printing the node unit in that case.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:00:30 +10:00
Benjamin Herrenschmidt 63b072735e Cache phandle of /chosen
We constantly access /chosen, among other in the console I/O routines
so instead of doing a path walk every time, cache the phandle

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:00:30 +10:00
Benjamin Herrenschmidt ec5c9e8bf4 Use root.fs on qemu as well
We had lots of duplication of code between root.fs and fdt.fs

The reason we didn't use root.fs in the first place is that it tried
to create the root node and the chosen node which we already have via
the fdt.

Instead, modify root.fs to check for their presence and only "extend"
them in that case.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:00:30 +10:00
Nikunj A Dadhania 2ecfaa4a86 usb-ehci: Add ehci handshake
After removal of the QTD, the device driver needs to make sure that
the host controller is really done with this QTD, and does not have
any local/cached copy of this. This is achieved by employing a 3-bit
handshake as explained in the echi spec 4.8.2 and Fig 4-10

Also add missing memory barrier.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06 16:00:30 +10:00
Nikunj A Dadhania 69772c33c2 usb: add mb for write accessors
Introduce mb() in all the variants of write_reg* before the hcall

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06 16:00:29 +10:00
Nikunj A Dadhania 3a83de22be usb-ohci: add missing memory barriers
* Start the control/bulk processing after ed is written
* Clear the content of control_head_ed and bulk_head_ed
  once done using them.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06 16:00:29 +10:00
Nikunj A Dadhania 67dafd87d2 usb-ohci: suspend the controller in exit code path
Moreover ehci already suspends the controller in the hcd_exit path. So
we can remove hc-suspend from the cleanup path.

Also, count mechanism is not needed anymore, as quiesce is called only
once.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-06 16:00:29 +10:00
Benjamin Herrenschmidt 225b8b0e3a usb-ohci: Add a reset when closing the OHCI
Or it will continue DMA'ing which is not a good idea. On recent qemu's
that add proper DMA error handling, it will get into error state.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:00:29 +10:00
Benjamin Herrenschmidt 14bca6ff9a usb: Use proper accessors for MMIO and separate in-memory endian swap
We cannot just access MMIO like that. On KVM for example, this has
to be hypercalls. On js2x, we need to use special cache-inhibited
loads and stores.

We have accessors in cache.h, we just need to use them. However that
means that read/write_reg() are no longer suitable for in-memory
byteswaps. We need to use the accessors in byteorder.h for that

While at it, we also fix the code to use mb() instead of barrier()
as a full memory barrier is needed to actually order things.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:00:29 +10:00
Benjamin Herrenschmidt a0236ff1b1 Use a global definition of sync() and mb()
For memory barriers accross the board. Also move the compiler barrier
to cpu.h

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-07-25 13:54:40 +10:00
Benjamin Herrenschmidt 8751768a48 net-snk: Remove exception handling
There is no point in overloading all the OFW exception vectors
and the "syscalls" are as well implemented as simple calls since
the "modules" don't use them anyway.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-07-25 13:09:17 +10:00
Nikunj A Dadhania d7354e2724 usb: unmap buffers
Clean up all the dma allocated buffers and remove their mappings.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania ac2fc97106 slof: call quiesce on closing of stdin
As quiesce is not a standard interface which is not what everybody
supports. Now make quiesce call when the stdin is closed. This makes
sure that the inteface is call always and is not dependent on OS
calling quiesce.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania ab811fced6 usb-kbd: accept "s" to drop to OF prompt
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 4be0500365 USB storage driver
* Integrated with generic scsi
* Support multiple LUNs

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
[ Changed to adapt to latest scsi rework ]
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 1b495eec59 usb-ohci: add Bulk transfer support
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Avik Sil b77cb97ec1 usb-ehci: Add bulk support
* Implement USB ehci bulk transfer
* USB core add bulk transfer api

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Avik Sil 56795bfabe usb-core: add usb bulk support
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania da1c3fa98a USB generic hub device driver
Support for usb generic hub driver.

Todo: Detect disconnects and remove device

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Avik Sil 875e0a233f usb-ehci: setup new device
Call usb-core routine to setup the newly found device

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Avik Sil a3aa903011 usb-ehci: Check ehci ports
Discover devices connected on the controller

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Avik Sil a12848da7e usb-ehci: initialize controller
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 6eb646603d USB keyboard driver
Portions of keyboard driver(usb-key.h and usb-hid.c) inherited from
code originally written by former SLOF team

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 2deb222c4c usb-core: setup new device
* Configures the newly found usb devices.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Fixes-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 912a746dc1 usb-core: create dev pool allocation
Have a device structure pool and provide apis usb_devpool_[get,put]

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 323108d792 usb-ohci: implement ohci send control
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 91826241af usb-core: usb send control
Introduce generice usb_send_control and implement correspoding stubs
in ohci and ehci

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 0376b7eb56 usb-core: implement usb_{get,put}_pipe routines
Generic routines to get pipe structure from controller.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30
Nikunj A Dadhania 0b4a392b66 usb-ohci: allocate pipe pool
usb-core: usb_pipe structure, this structure will be embedded in
	  controller specific pipe structure and accessed using
	  container_of macro.

usb-ohci: allocate pipe pool and support routines

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30