9
0
Fork 0
Commit Graph

132 Commits

Author SHA1 Message Date
Sascha Hauer be573120fe make cdev 64bit capable
Next step to 64bit support: Make cdev size a 64bit type.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer 3e503822c7 use loff_t for file offsets
This is a first step for 64bit file support: Make the file sizes/offsets
64bit.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer abe4560c8a Use DEVICE_ID_DYNAMIC where applicable
We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids,
Use it where applicable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-16 09:43:02 +02:00
Sascha Hauer dbd4e1166e device: make singular devices possible
Currently all devices have an id meaning that all devicenames
end with a number. This patch adds a DEVICE_ID_SINGLE to make
it ppossible to register a device without an id assigned to
it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:11:26 +02:00
Jan Weitzel 4088ab5588 NET: Add support for ks8851_mll
Add support for KS8851 16bit MLL chip from Micrel Inc.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-13 13:35:29 +01:00
Sascha Hauer 4bab39e7b6 remove unused variable from struct driver_d
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:28:10 +01:00
Sascha Hauer b482dfd612 driver: remove unused type_data field from struct driver_d
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:30 +01:00
Jean-Christophe PLAGNIOL-VILLARD ef654d1617 add gpio keyboard support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-02-16 18:17:30 +08:00
Jean-Christophe PLAGNIOL-VILLARD c40f026947 driver: switch driver_d name to const char*
this will allow to save 200 bytes on a9g20 and 180 bytes on ti xlaoder

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Sascha Hauer 40c9e6b22b Merge branch 'pu/misc' into next 2011-12-15 20:03:17 +01:00
Sascha Hauer 4ecd0003ac cdev: pass flags to open function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +01:00
Juergen Beisert c2580681e5 Remove the obsolet driver for the DM9000E ethernet device
Support for the old DM9000E device is now part of the new dm9k.c driver. So,
remove the old driver source and switch all users to the new driver.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 14:09:04 +01:00
Sascha Hauer 18e845efd9 implement resource management for platform devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-04 22:26:12 +01:00
Juergen Beisert 3ca9f1812f Create a unique cdev number for on demand devices
For disk like devices attached to MCI, ATA or USB it depends on the order they
will be recognized. So an unique number for all disk like devices is required.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-28 09:23:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD 808ec3192b resource: introduce add_generic_device_res to add multiple resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 21:12:46 +02:00
Jean-Christophe PLAGNIOL-VILLARD ad7590ee64 driver: remove map_base
as now all the drivers and board have been switch to resource whe can drop
map_base and size from device_d

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-08-01 16:33:44 +08:00
Jean-Christophe PLAGNIOL-VILLARD c71a77ab87 ns16550: switch to resource
use generic read/write depending on the memory size
if no reg_read/write defined

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-08-01 16:33:09 +08:00
Jean-Christophe PLAGNIOL-VILLARD ee80cbcd61 resource: introduce add_usb_ehci_device to register echi device
pass the hccr and hcor register base via resource

instroduce add_generic_usb_echi_device with hccr = base + 0x100 and
hcor = base + 0x140

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-29 14:05:22 +08:00
Jean-Christophe PLAGNIOL-VILLARD 06c36cf09e dm9000: introduce add_dm9000_device to register dm9000 device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-29 14:04:24 +08:00
Sascha Hauer a6aefdeaee Merge branches 'pu-ethaddr', 'pu-fec', 'pu-imx-iim', 'pu-resources' and 'pu-resources1' into next 2011-07-29 12:09:58 +02:00
Sascha Hauer ffcf536cef Merge branch 'pu' into next 2011-07-29 12:03:40 +02:00
Sascha Hauer 02b1926f5a fix typo
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-29 12:03:08 +02:00
Sascha Hauer 90c35f44f1 add a ns16550 registration helper and use it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-29 12:00:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 166388bcf6 resource: introduce add_cfi_device to register simple cfi device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-23 09:23:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 4b193e0755 resource: introduce add_generic_device to register simple device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-21 14:10:07 +08:00
Sascha Hauer f928efa818 add a add_mem_device function
Add a helper function for boards to register their memory
devices. This makes the board code smaller and also helps
getting rid of map_base and struct memory_platform_data.

And switch all of the memory to it

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 20:32:45 +08:00
Jean-Christophe PLAGNIOL-VILLARD 88618eb5f1 mem: replace DEVFS_RDWR by IORESOURCE_MEM_WRITEABLE
we keep struct memory_platform_data for now on we will switch off the memories
resources to struct resource

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 20:31:51 +08:00
Sascha Hauer d5b96bdca9 device: Add a dev_request_mem_region function
We might want to add real resource tracking later. Also
The first resource may not be a IORESOURCE_MEM at all.
For these reasons introduce a wrapper function for
driver so that they do not have to fiddle with resources
directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 20:20:04 +08:00
Jean-Christophe PLAGNIOL-VILLARD 126c9b69cf device: introduce resource structure to simplify resource declaration
and add multi resource per device support

for now we keep the old map_base and size temporary but will switch all of
the used step by step to them resource way

and mirror the first resource to the map_base and size if available

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:49 +08:00
Sascha Hauer 30be97aff2 devfs: factor out core devfs functionality
This makes it possible to compile without devfs. devfs_create/devfs_remove
is used by drivers and thus must still be present even without devfs support.
Also, this patch adds cdev_open/cdev_close/cdev_flush/cdev_ioctl calls to
work with devices without using the file api.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:07 +02:00
Sascha Hauer f1bb89fd9e fs: implement flush function
Once we have caching in file functions we need a way to sync
the the underlying devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:07 +02:00
Sascha Hauer 3efa8f7bed devfs: remove unused struct filep* argument from open/close
the cdev layer is under the file layer, so it should not use
struct filep*.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD c33a2e503c device: fix dev_name
dev_name is supposed to return the name of the device plus the id

currently we use %s%d format where in the kernel the use %s.%d
we may think to switch to this format for the device name and keeping the %s%d
for the devfs

this will be usefull to not modify the clock device name as example

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:56:37 +02:00
Jean-Christophe PLAGNIOL-VILLARD f2283c2057 use resource_size_t for device resources
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-27 14:25:19 +02:00
Sascha Hauer acc46ca4f0 add partition mtd support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 13:00:02 +02:00
Sascha Hauer c3789cd49b rework device parameters
Change device parameters so that the memory management is in generic
code. This also removes the need of storing statically initialized
parameters as they are stored in a struct list_head for each device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Sascha Hauer 73d57b1d35 list: remove duplicated list.h
We accidently have two list implementations in the tree:
include/list.h and include/linux/list.h. This patch moves
the latter (newer one) to include/linux/list.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-03 09:48:53 +01:00
Jean-Christophe PLAGNIOL-VILLARD 483d4e0857 driver: add dev_name inline
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-02 08:23:45 +01:00
Sascha Hauer f46010a1ab devfs: add open counter
Add an open counter for device files so that we cannot accidently
remove an opened device. This happened with bb devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-11 09:13:33 +02:00
Sascha Hauer 02ba8a0542 get rid of device ids
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:47 +02:00
Sascha Hauer 4b34297cfb Get rid of remaining DEVICE_TYPE_* usage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:46 +02:00
Sascha Hauer a2b7cd183b introduce cdev
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:44 +02:00
Sascha Hauer 4511a8873b we need different bus types
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-07 10:42:33 +02:00
Sascha Hauer 7703263340 fix dev_* macros
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-06 11:22:28 +02:00
Sascha Hauer 0b5a776c1e Shutdown U-Boot before starting an OS
Some devices, especially the ones doing DMA should be disabled before
giving control to an OS. We take the simple approach here: Just shutdown
the devices in the reverse order they were activated.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-19 12:21:18 +01:00
Sascha Hauer c3fc1364d9 Introduce dev_* and pr_* functions
Proven to be useful in linux kernel, U-Boot should have such a thing
aswell. We do not distinguish between the various print levels others
than debug and not debug.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-10-31 14:02:25 +01:00
Sascha Hauer e133ccdda8 implement memmap for mem driver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-14 10:25:56 +02:00
Sascha Hauer 65778b63d2 Partition: Add an own device id for partitions
Add an own device id for partitions. This is necessary to allow
the partition layer to check if the given device is really a partition.
Also, check for readonly flag in erase.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-14 09:28:10 +02:00
Sascha Hauer e6b42af9c5 increase maximum driver name length to 32
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-14 08:42:32 +02:00
Sascha Hauer a131b1abc3 Add new device types for NAND
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:14 +02:00
Sascha Hauer ee6d36a540 - introduce ioctl call
- pass open/close/lseek through to drivers
2008-06-06 09:30:48 +02:00
Juergen Beisert b90fc81605 doc added (what else) 2007-10-19 15:35:37 +02:00
Juergen Beisert 6ad2703e6e Merge branch 'master' of jbe@octopus:/home/git/projects/u-boot-v2 2007-10-19 11:58:33 +02:00
Juergen Beisert c616179204 doc added only 2007-10-19 11:58:22 +02:00
sascha 83f101bc30 fix compiler warning 2007-10-19 11:06:32 +02:00
sascha 3b6d6a45e7 - Implement tree structure for devices
- Use device tree structure to implement partitions
- Let devinfo print a nice tree
- Introduce 'fixed' partitions which are not removable
- Fix mount: It was not possible to mount on a relative path.
2007-10-19 08:45:57 +02:00
Sascha Hauer 212f631eb4 let erase and protect functions return int instead of size_t. They
only return succes/error but no size.
2007-10-11 22:00:22 +02:00
Sascha Hauer eadf71abc7 Use Linux kernel list for drivers and devices instead of handmade
list.
2007-10-11 20:20:36 +02:00
Sascha Hauer 056a695c15 implement flash protection 2007-07-16 10:29:28 +02:00
Sascha Hauer 665291e693 implement memmap().
With this function we can get a pointer to directly memory mapped
devices like nor flash or RAM. Useful for bootm where we save one
memcopy when the image is mappable
2007-07-15 13:50:04 +02:00
Sascha Hauer b844766e03 whitespace cleanup 2007-07-15 12:43:20 +02:00
Sascha Hauer 06bc41745b svn_rev_575
add DEVICE_TYPE_MIIPHY
2007-07-05 18:02:06 +02:00
Sascha Hauer fe2d505d4d svn_rev_481
make more char * const, fix compiler warnings
2007-07-05 18:01:58 +02:00
Sascha Hauer 7baa6289fe svn_rev_469
- make some more char * const
- dev_add_parameter -> dev_add_param
2007-07-05 18:01:56 +02:00
Sascha Hauer a571261fed svn_rev_387
add console driver type
2007-07-05 18:01:49 +02:00
Sascha Hauer e6bd6faf63 svn_rev_366
make pointer const
2007-07-05 18:01:47 +02:00
Sascha Hauer 2897414d14 svn_rev_319
add some comments
2007-07-05 18:01:43 +02:00
Sascha Hauer 4195bc3323 svn_rev_296 2007-07-05 18:01:40 +02:00
Sascha Hauer 93ca1de96a svn_rev_291
add get_first_device() function
2007-07-05 18:01:40 +02:00
Sascha Hauer 0f184e3a55 svn_rev_273
split up header files, make src pointer in write functions const
2007-07-05 18:01:39 +02:00
Sascha Hauer 112ada667b svn_rev_270
WIP FS support
2007-07-05 18:01:38 +02:00
Sascha Hauer cf7a56fc78 svn_rev_268
WIP
2007-07-05 18:01:38 +02:00
Sascha Hauer 9db8ed3312 svn_rev_261
WIP Filesystem support
2007-07-05 18:01:37 +02:00
Sascha Hauer 7880ba6372 svn_rev_235
beginning filesystem support
2007-07-05 18:01:35 +02:00
Sascha Hauer a089e67dce svn_rev_231
moved param related things to extra header file
2007-07-05 18:01:35 +02:00
Sascha Hauer 8dcc816ba9 svn_rev_227
fix parameter handling
2007-07-05 18:01:34 +02:00
Sascha Hauer 76694f989c svn_rev_204 2007-07-05 18:01:32 +02:00
Sascha Hauer 42e2dbc120 svn_rev_149
no need for bi_dram in global data (untested)
2007-07-05 18:01:27 +02:00
Sascha Hauer a0b0cfc5ed svn_rev_121
implement device parameters
2007-07-05 18:01:25 +02:00
Sascha Hauer 55ebf67d3e svn_rev_120
implement initcalls
2007-07-05 18:01:24 +02:00
Sascha Hauer 658cc34395 svn_rev_118
thousands of things
2007-07-05 18:01:24 +02:00
Sascha Hauer abfbbad1eb svn_rev_109
do not know anymore
2007-07-05 18:01:23 +02:00