9
0
Fork 0
Commit Graph

112 Commits

Author SHA1 Message Date
Juergen Beisert 069e1f45c8 serial S3: fix local structure malloc
Patch 2c54046510 introduces a private structure
for the S3C based UARTs but still reserves the memory for the smaller
structure which fails at runtime.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-13 13:23:46 +01:00
Robert Jarzmik f67fc4fb7a drivers/serial: trivial regression fix
Fix commit "serial pxa: fix unregister", which forgot a
semicolon, breaking serial_pxa compilation.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-29 08:28:20 +01:00
Sascha Hauer 2c54046510 serial s3c: add a driver private struct
Do not use dev->priv as a register base, but use a driver private
struct instead. Also, remove usage of dev->type_data

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:18 +01:00
Sascha Hauer 6dfb9fec5f serial stm: fix unregister
- Add missing console_unregister call
- use dev->priv instead of dev->type_data

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:14 +01:00
Sascha Hauer 0f7b86f1cb serial imx: fix unregister
- Add missing console_unregister call
- use dev->priv instead of dev->type_data

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:14 +01:00
Sascha Hauer b059ed8184 serial pxa: fix unregister
- Add missing console_unregister call
- use dev->priv instead of dev->type_data

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:14 +01:00
Sascha Hauer 837a0c2e04 serial drivers: remove unused type_data
Several serial drivers set the type_data field without ever using it,
so just remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:14 +01:00
Antony Pavlov cb76204fa8 ns16550: fix ier selection
The document "PC16550D Universal Asynchronous
Receiver Transmitter with FIFOs" (vers. June 1995,
http://www.national.com/ds/PC/PC16550D.pdf) states
that IER (Interrupt Enable Register) is accessible
if the bit DLAB = 0 (DLAB is bit 7 in LCR; in barebox
DLAB known as LCR_BKSE).

So before IER access we need set DLAB to 0.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-19 09:46:02 +01:00
Antony Pavlov b36dd65f15 ns16550: write zero to ier only once
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-19 09:46:02 +01:00
Antony Pavlov fd434ce24a ns16550: make ns16550_serial_init_port() shorter
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-19 09:46:02 +01:00
Antony Pavlov 5891ba14b8 ns16550: support for UART with broken FIFO
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-19 09:46:02 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3fc38b0c5b serial: drop non used at91rm9200 driver
we use atmel driver now

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-06 09:42:30 +01:00
Juergen Beisert b8560b2b2f MACH SAMSUNG/S3C: Unify the UART driver for the S3C family of CPUs
The UART is one of the units which differs only slightly inside the S3C family.
Prepare this driver to share it with more recent CPUs.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 13:32:13 +01:00
Juergen Beisert 4e7151d11c MACH SAMSUNG/S3C: Separate S3C24XX clock management
There are major differences in the clock tree of the S3C24xx family and the
more recent CPUs of the S3C family. Keep the S3C24XX clock routines separate to
avoid an ifdef hell. But also use generic function names to be able to
share drivers among the S3C family.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 13:32:13 +01:00
Juergen Beisert cbc08bfb42 MACH SAMSUNG/S3C: Make it more generic for future updates
Start with renaming files to share them in the S3C CPU family,

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 13:32:13 +01:00
Sascha Hauer 4b8750c956 uart drivers: use xzalloc instead of xmalloc
The flags in struct console_device have to be initialized
to zero. Otherwise the following can happen:

- console_register sets the initial baudrate of a new console
  before we set the global console init state to CONSOLE_INIT_FULL.
- In console_baudrate_set we test whether the current console is
  active which may be true because of unitialized flags.
- we then call getc() to wait for the user to accept the new settings
  and we are stuck because of the CONSOLE_UNINITIALIZED state
  we will never get anything from getc().

Looking back this explains some cases for me when barebox refused
to start and I really wonder why this did not become a more visible
problem before.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-23 11:15:44 +01:00
Marc Kleine-Budde 36c47ce426 arm/mach-pxa: Initial Intel/Marvell PXA support
The core support was brought by Marc and Sascha.
The cache choice was fixed by Luotao Fu.
Some gpio and devices addons were provided by Robert.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 09:30:27 +01:00
Juergen Beisert 6fa8c93a5e S3C24XX: Fix wrong RTS behaviour
Enabling AUTOSYNC means enabling the auto sync feature, not rising the RTS

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-27 12:16:55 +01:00
Sascha Hauer d01070c8af remove EARLY_INIT and EARLY_CONSOLE support
Bitrotted over time and nearly unused, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 10:27:18 +02:00
Sascha Hauer 3ee7877a48 introduce io.h
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-22 19:03:05 +02:00
Jean-Christophe PLAGNIOL-VILLARD a3edff8238 arm_dcc: fix missing switch to resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-10 14:53:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD b9605d8a96 at91: swtich to clkdev
this will also fix the clock support as we now switch to allocated generic
device

as we can need to associate the clock and the device but the driver is probe
before the association

we also change the atmel serial name to "atmel_usart" to simplify sharing with
linux

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-10 14:53:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD 454f331bfe serial_ns16550: drop the non working check
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-04 09:04:25 +02: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 931c1cc5a6 ns16550: if not specific f_caps defined use default stdin, stdout, stderr
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-30 02:05:27 +08:00
Marc Kleine-Budde 9eaaf1b1ca ARM: add support for the i.MX53
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-29 12:10:38 +02:00
Sascha Hauer 784030e136 serial mpc5xxx: get rid of map_base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:25:04 +02:00
Sascha Hauer 39a7d5ff9c serial stm: get rid of map_base
While at it, dynamically allocate private driver struct.
There might be only a single instance of this driver,
but don't be a bad example for others.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:21:24 +02:00
Sascha Hauer 36a16d6509 serial pl010: get rid of map_base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:08:41 +02:00
Sascha Hauer f0c1332780 serial s3c: get rid of map_base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:05:37 +02:00
Sascha Hauer 801b379c36 serial netx: get rid of map_base
While at it, switch to standard readl/writel accessors

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:04:50 +02:00
Franck Jullien 389f3ea067 nios2/altera_serial_jtag: Switch to resources
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-27 10:54:13 +02:00
Franck Jullien 2c628dbadd nios2/serial_altera: Switch to resources
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-27 10:54:13 +02:00
Antony Pavlov 5998165c1a DRIVER_SERIAL_LINUX_CONSOLE: fix misprint
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-25 11:25:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 183b39dae4 amba-pl011: switch to dev_request_mem_region
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-20 08:25:45 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5fa6f80f65 amba-pl011: fix missing switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-20 08:25:44 +02:00
Jean-Christophe PLAGNIOL-VILLARD 358ab3eb84 atmel/drivers: switch to dev_request_mem_region
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-20 08:25:43 +02:00
Sascha Hauer f820d7e097 serial i.MX: convert to struct resource
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-19 00:12:50 +08:00
Jean-Christophe PLAGNIOL-VILLARD 0c96353957 amba-pl011: switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:52 +08:00
Jean-Christophe PLAGNIOL-VILLARD 0898d1515a at91/serial: switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:50 +08:00
Antony Pavlov f4f952faa4 serial_ns16550: remove legacy code copied from U-Boot v1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-17 17:42:21 +02:00
Franck Jullien 9d64e1f21d Add Altera JTAG UART driver
Add Altera JTAG UART driver

I removed the CONFIG_ALTERA_JTAG_UART_BYPASS.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-10 09:32:27 +02:00
Sascha Hauer a03277592f serial 16550: use xzalloc
No need to check for the result and increases the chance that we
build a binary without the rarely used calloc function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:08 +02:00
Franck JULLIEN 7834d07751 Nios2: Add Altera UART driver
This patch adds Altera UART driver. Kconfig and Makefile are
updated to include this new driver.

Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-08 11:37:23 +02:00
Sascha Hauer e88d86a445 ARM: rename STM arch to mxs
We never supported the sigmatel stm chips and probably
never will. So do the first step and rename the architecture
to mxs just like in the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-20 10:43:24 +01:00
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Juergen Beisert 8e46fc7238 STM378x: Adapt the serial driver to support i.MX23 and i.MX28
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:06 +01:00
Juergen Beisert e4f17bd394 STM378x: Do not configure any pin usage in the driver
Only the platform should configure pins to be used by the driver.
The driver must work independently from the settings.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:06 +01:00
Juergen Beisert 8dc537022e STM378x: Use Hz as the clock unit like in all other arch
i.MX23 currently uses kHz as the unit for its clock handling and calculation
to avoid overflows when calculation with the internal 480 MHz PLL and its
fractional divider. This patch changes all routines to accept Hz and deliver
Hz as the clock unit.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:06 +01:00
Marek Belisko c22da7e05d serial_s3c24x0: Add missing brackets.
Fucntion s3c24x0_serial_flush() could behave wrong
because of missing brackets. Correct condition logic.
Problem found by sparse.

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-17 09:46:29 +01:00