mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 11:24:42 +00:00
ATA: Squash warnings in mxc_ata.
mxc_ata.c: In function ‘set_ata_bus_timing’: mxc_ata.c:118: warning: dereferencing type-punned pointer will break strict-aliasing rules mxc_ata.c:125: warning: dereferencing type-punned pointer will break strict-aliasing rules mxc_ata.c:129: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Stefano Babic <sbabic@denx.de>
This commit is contained in:
parent
db545e49b7
commit
e063342c0e
1 changed files with 9 additions and 13 deletions
|
@ -96,7 +96,6 @@ static uint16_t pio_tA[NR_PIO_SPECS] = { 50, 50, 50, 50, 50 };
|
||||||
#define REG2OFF(reg) ((((uint32_t)reg) & 0x3) * 8)
|
#define REG2OFF(reg) ((((uint32_t)reg) & 0x3) * 8)
|
||||||
static void set_ata_bus_timing(unsigned char mode)
|
static void set_ata_bus_timing(unsigned char mode)
|
||||||
{
|
{
|
||||||
uint32_t val;
|
|
||||||
uint32_t T = 1000000000 / mxc_get_clock(MXC_IPG_CLK);
|
uint32_t T = 1000000000 / mxc_get_clock(MXC_IPG_CLK);
|
||||||
|
|
||||||
struct mxc_ata_config_regs *ata_regs;
|
struct mxc_ata_config_regs *ata_regs;
|
||||||
|
@ -106,22 +105,19 @@ static void set_ata_bus_timing(unsigned char mode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Write TIME_OFF/ON/1/2W */
|
/* Write TIME_OFF/ON/1/2W */
|
||||||
val = (3 << REG2OFF(&ata_regs->time_off)) |
|
writeb(3, &ata_regs->time_off);
|
||||||
(3 << REG2OFF(&ata_regs->time_on)) |
|
writeb(3, &ata_regs->time_on);
|
||||||
(((pio_t1[mode] + T) / T) << REG2OFF(&ata_regs->time_1)) |
|
writeb((pio_t1[mode] + T) / T, &ata_regs->time_1);
|
||||||
(((pio_t2_8[mode] + T) / T) << REG2OFF(&ata_regs->time_2w));
|
writeb((pio_t2_8[mode] + T) / T, &ata_regs->time_2w);
|
||||||
writel(val, &ata_regs->time_off);
|
|
||||||
|
|
||||||
/* Write TIME_2R/AX/RDX/4 */
|
/* Write TIME_2R/AX/RDX/4 */
|
||||||
val = (((pio_t2_8[mode] + T) / T) << REG2OFF(&ata_regs->time_2r)) |
|
writeb((pio_t2_8[mode] + T) / T, &ata_regs->time_2r);
|
||||||
(((pio_tA[mode] + T) / T + 2) << REG2OFF(&ata_regs->time_ax)) |
|
writeb((pio_tA[mode] + T) / T + 2, &ata_regs->time_ax);
|
||||||
(1 << REG2OFF(&ata_regs->time_pio_rdx)) |
|
writeb(1, &ata_regs->time_pio_rdx);
|
||||||
(((pio_t4[mode] + T) / T) << REG2OFF(&ata_regs->time_4));
|
writeb((pio_t4[mode] + T) / T, &ata_regs->time_4);
|
||||||
writel(val, &ata_regs->time_2r);
|
|
||||||
|
|
||||||
/* Write TIME_9 ; the rest of timing registers is irrelevant for PIO */
|
/* Write TIME_9 ; the rest of timing registers is irrelevant for PIO */
|
||||||
val = (((pio_t9[mode] + T) / T) << REG2OFF(&ata_regs->time_9));
|
writeb((pio_t9[mode] + T) / T, &ata_regs->time_9);
|
||||||
writel(val, &ata_regs->time_9);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ide_preinit(void)
|
int ide_preinit(void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue