mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Roberto Nibali <rnibali@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: Booting mx25 based device from SD and NOR
Date: Thu, 31 May 2012 15:12:08 +0200	[thread overview]
Message-ID: <CAONxwYNf7_+H1oC2AuL2A_edBXqqkdSjxt6eFwPvU4VS+UzU0g@mail.gmail.com> (raw)
In-Reply-To: <20120530054738.GF30400@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 16094 bytes --]

Hi

> +#
> > +# (C) Copyright 2007 Juergen Beisert <jbe@pengutronix.de>
>
> You should replace this with your own copyright. I think Jürgen can live
> with not having a copyright on trivial files ;)
>

Ok, will do.


> > diff --git a/arch/arm/boards/fq-sid1-mx25-noah/env/config
>
> Have you considered using one of the environment templates? You
> shouldn't duplicate them.


I haven't, I'll have look into them once I get NOR and SD card
functionality inside barebox ... for which I have exactly one day left :).


> > +# or set your networking parameters here
> > +#eth0.ipaddr=192.168.1.80
> > +#eth0.netmask=255.255.255.0
> > +#eth0.gateway=a.b.c.d
> > +eth0.serverip=192.168.1.23
> > +eth0.ethaddr=00:50:c2:8c:e6:0e
>
> *never* *ever* add MAC addresses to the default environment.


 Ok. In my case, the MAC address is actually stored inside a secured at24
EEPROM buffer. Unfortunately, at24 via I2C does not seem to be available in
barebox. I reckon I have to port it from the kernel or uboot :).


> > + { .ptr_type = 4, .addr = 0xb8001004, .val = 0x0076e83a, }, /* initial
> > value for ESDCFG0 */
>
> Your mailer wraps lines.


Yeah, sorry for that, gmail is all I have at the moment, however for
serious inclusion or review of any patches, I'll definitely try to resort
to ``git send-email''


> > +#endif
> > +#ifdef CONFIG_DRIVER_VIDEO_IMX
> > + //imx25_add_fb(&noah_fb_data);
>
> Please remove dead code before posting this for inclusion


Will do, thanks.

I have included some more debugging and also workarounds for the mx25. This
is the current debug output, where it clearly indicates that for some
reason the mx25 esdhc related registers never show a transfer complete for
a multiblock write:

Board: SID1 NOAH
registered netconsole as cs1
noah_read_ccm_regs: CCM CRDR = 00000000
noah_read_ccm_regs: CCM RCSR = 01020820
noah_read_ccm_regs: Booting from WEIM: NOR
imx-esdhc@mci0: registered as mci0
imx-esdhc@imx-esdhc0: set clock: wanted: 400000 got: 377840
imx-esdhc@imx-esdhc0: pre_div: 8 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 200000 got: 188920
imx-esdhc@imx-esdhc0: pre_div: 16 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 200000 got: 188920
imx-esdhc@imx-esdhc0: pre_div: 16 div: 10
mci@mci0: SD Card Rev. 2.00 or later detected
mci@mci0: Put the Card in Identify Mode
mci@mci0: Card's identification data is: 1B534D30-30303030-101ABB6A-9500AB00
mci@mci0: Get/Set relative address
mci@mci0: Get card's specific data
mci@mci0: Card's specific data is: 007FFF32-5B5A83BA-F6DBDFFF-0E800000
mci@mci0: Transfer speed: 25000000
mci@mci0: Max. block length are: Write=1024, Read=1024 Bytes
mci@mci0: Capacity: 1910 MiB
mci@mci0: Limiting max. read block size down to 512
mci@mci0: Limiting max. write block size down to 512
mci@mci0: Read block length: 512, Write block length: 512
mci@mci0: Select the card, and put it into Transfer Mode
mci@mci0: Changing transfer frequency
mci@mci0: Trying to read the SCR (try 1 of 3)
esdhc_setup_data: Check if workaround ENGcm01112 is needed
    on i.MX25 (0x00000008)
esdhc_setup_data: Enabling workaround for ENGcm01112 on i.MX25
esdhc_setup_data: Check if workaround ENGcm01112 is needed
    on i.MX25 (0x00000008)
esdhc_setup_data: Enabling workaround for ENGcm01112 on i.MX25
esdhc_setup_data: Check if workaround ENGcm01112 is needed
    on i.MX25 (0x00000040)
esdhc_setup_data: Enabling workaround for ENGcm01112 on i.MX25
mci@mci0: Prepare for bus width change
mci@mci0: Set SD bus width to 4 bit
imx-esdhc@imx-esdhc0: set clock: wanted: 200000 got: 188920
imx-esdhc@imx-esdhc0: pre_div: 16 div: 10
imx-esdhc@imx-esdhc0: set clock: wanted: 50000000 got: 33250000
imx-esdhc@imx-esdhc0: pre_div: 0 div: 1
mci@mci0: Card is up and running now, registering as a disk
mci@mci0: registered disk0
mci@mci0: mci_sd_read: Read 1 block(s), starting at 0
mci@mci0: READ: Activating single block transfer
esdhc_setup_data: Check if workaround ENGcm01112 is needed
    on i.MX25 (0x00000040)
esdhc_setup_data: Enabling workaround for ENGcm01112 on i.MX25
mci@mci0: SD Card successfully added
imx25_devices_init: Adding NOR flash device
cfi_flash@cfi_flash0: cfi flash (id=01000000 vend=000002 manu=000001
devid=00007E extid=002301) at a0000000, size 64MB
imx25_devices_init: Adding initial NOR flash partitions
ehci@ehci0: USB EHCI 1.00
Malloc space: 0x83b00000 -> 0x83efffff (size  4 MB)
Stack space : 0x83af8000 -> 0x83b00000 (size 32 kB)
envfs: wrong magic on /dev/env0
no valid environment found on /dev/env0. Using default environment
running /env/bin/init...

Hit any key to stop autoboot:  4

type update_kernel nor [<imagename>] to update kernel into flash
type update_root nor [<imagename>] to update rootfs into flash

sid1-noah:/ mkdir /mnt
sid1-noah:/ mount /dev/disk0.0 fat /mnt
mci@mci0: mci_sd_read: Read 128 block(s), starting at 2048
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
sid1-noah:/ cp /mnt/conmci@mci0: mci_sd_read: Read 128 block(s), starting
at 2560
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
sole_image.jffs2 /mnt/console_image.jffs2-backup
mci@mci0: mci_sd_read: Read 128 block(s), starting at 3584
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
mci@mci0: mci_sd_read: Read 128 block(s), starting at 2304
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
mci@mci0: mci_sd_read: Read 128 block(s), starting at 53760
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
mci@mci0: mci_sd_read: Read 128 block(s), starting at 3712
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
mci@mci0: mci_sd_read: Read 128 block(s), starting at 53888
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
mci@mci0: mci_sd_read: Read 128 block(s), starting at 3840
mci@mci0: READ: Activating multiple block transfer
block_cache: blk->ops->read returned 0
mci@mci0: mci_sd_write: Write 128 block(s), starting at 2560
mci@mci0: WRITE: Activating multiple block transfer

Data Write Failed in PIO Mode.imx-esdhc@imx-esdhc0: timeout 2
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Writing block 2560 failed with -110
mci@mci0: mci_sd_read: Read 128 block(s), starting at 54016
mci@mci0: READ: Activating multiple block transfer
esdhc_send_cmd: busy loop 1 CMD=0x01a60000 (0x00000012) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x01a60000 (0x00000012) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x01a60000 (0x00000012) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Reading block 54016 failed with -110
block_cache: blk->ops->read returned -110
write: I/O error
mci@mci0: mci_sd_write: Write 128 block(s), starting at 2048
mci@mci0: WRITE: Activating multiple block transfer
esdhc_send_cmd: busy loop 1 CMD=0x00100000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00100000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00100000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Writing block 2048 failed with -110
mci@mci0: mci_sd_write: Write 128 block(s), starting at 2304
mci@mci0: WRITE: Activating multiple block transfer
esdhc_send_cmd: busy loop 1 CMD=0x00120000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00120000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00120000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Writing block 2304 failed with -110
mci@mci0: mci_sd_write: Write 128 block(s), starting at 53888
mci@mci0: WRITE: Activating multiple block transfer
esdhc_send_cmd: busy loop 1 CMD=0x01a50000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x01a50000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x01a50000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Writing block 53888 failed with -110
mci@mci0: mci_sd_write: Write 128 block(s), starting at 53760
mci@mci0: WRITE: Activating multiple block transfer
esdhc_send_cmd: busy loop 1 CMD=0x01a40000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x01a40000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x01a40000 (0x00000019) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Writing block 53760 failed with -110
mci@mci0: mci_sd_read: Read 128 block(s), starting at 2560
mci@mci0: READ: Activating multiple block transfer
esdhc_send_cmd: busy loop 1 CMD=0x00140000 (0x00000012) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00140000 (0x00000012) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00140000 (0x00000012) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
esdhc_send_cmd: busy loop 1 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 2 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
esdhc_send_cmd: busy loop 3 CMD=0x00000000 (0x0000000c) cap=0x07f30000
    irqstat=0x00000000 proctl=0x00000022 prsstat=0xf7880587
 xfertyp=0x0c3b0022 sysctl=0x000e0017 blkattr=0x00700200
imx-esdhc@imx-esdhc0: timeout 1
mci@mci0: Reading block 2560 failed with -110
block_cache: blk->ops->read returned -110

I'll start looking at the uboot drivers, since the kernel drivers are quite
messy with regard to the software stack a SD cmd has to travel. In any
case, you before dropping a new barebox  release, you might want to
consider this cosmetic change:

diff --git a/drivers/mci/imx-esdhc.h b/drivers/mci/imx-esdhc.h
index 19fed5a..d9be69e 100644
--- a/drivers/mci/imx-esdhc.h
+++ b/drivers/mci/imx-esdhc.h
@@ -39,7 +39,6 @@
 #define SYSCTL_PEREN           0x00000004
 #define SYSCTL_HCKEN           0x00000002
 #define SYSCTL_IPGEN           0x00000001
-#define SYSCTL_RSTA            0x01000000

 #define IRQSTAT                        0x0002e030
 #define IRQSTAT_DMAE           (0x10000000)

Best regards
Roberto

[-- Attachment #1.2: Type: text/html, Size: 20016 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-05-31 13:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 12:11 Roberto Nibali
2012-05-22 18:42 ` Sascha Hauer
2012-05-23 10:43   ` Roberto Nibali
2012-05-23 11:47     ` Eric Bénard
2012-05-24 12:49       ` Roberto Nibali
2012-05-24 12:58         ` Eric Bénard
2012-05-24 13:18           ` Roberto Nibali
2012-05-24 13:31             ` Eric Bénard
2012-05-25  9:04               ` Roberto Nibali
2012-05-25 10:08                 ` Eric Bénard
2012-05-29  9:06                   ` Roberto Nibali
2012-05-29  9:29                     ` Sascha Hauer
2012-05-29  9:56                       ` Roberto Nibali
2012-05-29 10:14                         ` Roberto Nibali
2012-05-30  5:47                           ` Sascha Hauer
2012-05-30  6:39                             ` Juergen Beisert
2012-05-31 13:12                             ` Roberto Nibali [this message]
2012-05-31 17:06                               ` Sascha Hauer
2012-06-01 10:25                                 ` Roberto Nibali
2012-06-05  7:09                                   ` Sascha Hauer
2012-05-24 17:17             ` Sascha Hauer
2012-05-25  9:19               ` Roberto Nibali
2012-05-25 10:01                 ` Sascha Hauer
2012-05-29  9:26                   ` Roberto Nibali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAONxwYNf7_+H1oC2AuL2A_edBXqqkdSjxt6eFwPvU4VS+UzU0g@mail.gmail.com \
    --to=rnibali@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox