Commit Graph

147 Commits

Author SHA1 Message Date
Avik Sil b6226fd829 Add missing close-dev in ping
Without the close-dev successive ping command fails to get the arguments,
because the net device is not instantiated as the open-count is not
decremented.

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:53 +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 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 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 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 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 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 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
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 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
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 3ee6dcc875 usb-slof: forth support routines for C
Code inherited from libusb code 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:22 +05:30
Avik Sil f904d52976 usb-ehci: Add USB EHCI skeleton
Dump EHCI registers

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:22 +05:30
Nikunj A Dadhania a4e14d308f usb-core: hcd registration and query routines
* usb-core: hcd registration
  	    query hcd operations structure
            hcd controller init routines
* usb-ohci: stub ochi controller init

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 7ef8498799 usb-core: adding generic dev-hci.fs
* Generic forth device file for [OEX]HCI controller.
* Routines to setup hcd structure

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
[ implmented generic hc-suspend for [oe]hci ]
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 c4ddc59f67 usb-core: registration and makefiles
* Introduce libusb
* USB core register routine and required forth changes
* USB OHCI skeleton file

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@de.ibm.com>
2013-07-24 14:46:22 +05:30
Nikunj A Dadhania 3c7febb48f Add new USB code
* Create usb directory
* Remove compilation of slof-usb code
* Generalize pci-class_0c.fs
* Add usb-static.fs with alias and dummy usb-scan

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 beb8512fec Remove old usb code
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
Avik Sil 18a5c483e8 Enumerate disk/cdrom aliases for multiple disks or cdroms
This patch enumerates aliases (e.g. disk, disk1, disk2 etc.)
for multiple disk or cdrom provided

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30
Nikunj A Dadhania 2fe02a36df scsi: unify scsi probing code
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30
Nikunj A Dadhania ec63c93846 scsi: unify and use make-disk-alias
Combine both cdrom and disk alias creation.
[ some more scope of unifying discovery routine ]

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-07-24 14:46:21 +05:30
Benjamin Herrenschmidt b96c867a33 Add hack to client interface finddevice of "/memory"
grub2 is bogus, it looks for "/memory" to check for available
memory. On a system with multiple memory nodes that might return
anything and not necessarily the RMA node which is the only one
usable in real mode.

This adds a hack to the client interface code which transforms
any request for "/memory" to explicitly look for "/memory@0"
which returns the RMA node.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-27 20:14:14 +10:00
Nikunj A Dadhania 0ad6924790 scsi: Fix cdrom boot crash when no medium present
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-27 20:02:04 +10:00
Benjamin Herrenschmidt f21b89fffc Fix instance>qname crashing when displaying instance arguments
Which was triggere by the vscsi error display code

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-27 19:31:42 +10:00
Benjamin Herrenschmidt 48eec205c1 scsi-disk: Bound check read-blocks
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-27 19:31:42 +10:00
Benjamin Herrenschmidt a498136b51 Fix off by one error in scsi-disk get-capacity
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-27 19:31:42 +10:00
Nikunj A Dadhania e3d494b2ed scsi: fix report-luns handling
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-06-27 19:31:42 +10:00
Benjamin Herrenschmidt 1da4a14a37 scsi: Move bits of vio-vscsi.fs to a common helpers file
Currently meant to be included by host drivers to add standard
methods to them.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-05 16:12:39 +10:00
Benjamin Herrenschmidt 267b7adb94 scsi: Move scsi-disk.fs to a generic place
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-05 16:12:39 +10:00
Benjamin Herrenschmidt 220637a137 iso9660: Don't constantly reallocate the read buffer
If it's big enough, re-use it !

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-03 14:48:10 +10:00
Benjamin Herrenschmidt 942bca954f vscsi: Sanitize interface between scsi-disk.fs and vio-vscsi.fs
We now exclusively use the proper SCSI command interface to vio-vscsi.fs
and move all of the higher level command building from vio-vscsi.fs
to scsi-disk.fs with the exception of the ones used during probe.

[ Even those could be moved out by in large part by opening/closing
  the device and letting it print its own inquiry data but that's less
  urgent. In fact we could have a generic "Probe SCSI bus" helper
]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-06-03 14:47:48 +10:00
Benjamin Herrenschmidt d4b8196c1e vio-vscsi: Rework vio-vscsi support
This reworks the vio-vscsi driver to funnel all SCSI commands through
a more/less generic SCSI command interface. Adds the ability to retry
based on the sense code and busy status and handles various conditions
better.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-27 14:40:57 +10:00
Dinar Valeev 0a389ba95d disk-label: Allocate 4096 bytes for 4k block devices
To make 4k scsi devices to work, allocated memory needs to be increased
accordingly

Tested in the following scenario:

modprobe scsi_debug dev_size_mb=100 sector_size=4096

parted /dev/sdc u b p
Model: Linux scsi_debug (scsi)
Disk /dev/sdc: 209715200B
Sector size (logical/physical): 4096B/4096B
Partition Table: msdos

Number Start End Size Type File system Flags
1 262144B 2097151B 1835008B primary boot,
prep, type=41
2 2097152B 200015871B 197918720B primary type=83

qemu-system-ppc64 -enable-kvm -M pseries -m 1024 -nographic -drive
file=/dev/sdc,if=none,format=raw,id=drive-scsi0 -device
scsi-block,drive=drive-scsi0,id=scsi0 -vga none

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-21 09:48:40 +10:00
Benjamin Herrenschmidt b35fffc1c7 disk-label: Increase the max size of the PReP boot partition
Some folks put a whole zImage in there, and we can easily cope
with more than 8M nowadays.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-21 09:48:36 +10:00
Benjamin Herrenschmidt 099d99e73d Make load-base a real environment variable
It can be stored in nvram. It defaults to a platform specified default
currently set to 256MB on js2x and 16K on qemu.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13 14:08:07 +10:00
Benjamin Herrenschmidt 7251f5d1dd Fix disk-label package to use proper instance path
This fixes booting from a path that has an explicitly specified
unit address on a wildcard node

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13 11:13:35 +10:00
Benjamin Herrenschmidt 0ac9a96d1f Increase size of catpad
Just paranoid...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13 11:13:35 +10:00
Benjamin Herrenschmidt d285aed099 Fix instance>path to contain unit address for wildcard nodes
instance>path (and instance>qpath) which are used among others by
the client interface "instance-to-path" are broken when dealing
with wildcard nodes (node with no unit address which obtain one
when opened).

This fixes this by properly using the instance address when building
instance path.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13 11:13:14 +10:00
Benjamin Herrenschmidt f2199038bf Fix handling of wildcard nodes in open-dev
There was a hack there involving having no #address-cells property
in the parent and "manual" parsing of the resulting address numbers
but this really didn't work properly.

I added (the hack is still there until I'm sure nothing relies on it)
a proper handling of wildcard nodes, changing match-unit to match them
properly, and recovering the unit address in find-component.

There are still issues, among other instance>package still loses the
unit address, as does disk-label (for different reasons).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-05-13 11:13:10 +10:00
Stefan Weil f564e52f44 Spelling fixes in forth code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-01-04 10:14:26 +05:30
Stefan Weil d070068574 Spelling fixes in comments and debug messages
Most of these errors were found by codespell:

controler -> controller
appropiate -> appropriate
devide -> divide
comming -> coming
seperate -> separate
reponsible -> responsible
initialization -> initialization
successfull -> successful
whithin -> within
recieve -> receive
wich -> which
occurence -> occurrence
beggining -> beginning
accessable -> accessible
proccess -> process
succesfuly -> successfully
immediatly -> immediately
prefered -> preferred
avaliable -> available
threshhold -> threshold
statistsics -> statistics
endianess -> endianness
positon -> position
writen -> written
occurence -> occurrence
upto -> up to
overwriten -> overwritten
availabe -> available
enviroment -> environment
intruction -> instruction
thru -> through
substract -> subtract
occured -> occurred
begining -> beginning
lenght -> length
atributes -> attributes
preceeding -> preceding
defintion -> definition
decriptor -> descriptor

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-01-04 10:12:48 +05:30