162306a36Sopenharmony_ci /*
262306a36Sopenharmony_ci  * PMC-Sierra SPC 8001 SAS/SATA based host adapters driver
362306a36Sopenharmony_ci  *
462306a36Sopenharmony_ci  * Copyright (c) 2008-2009 USI Co., Ltd.
562306a36Sopenharmony_ci  * All rights reserved.
662306a36Sopenharmony_ci  *
762306a36Sopenharmony_ci  * Redistribution and use in source and binary forms, with or without
862306a36Sopenharmony_ci  * modification, are permitted provided that the following conditions
962306a36Sopenharmony_ci  * are met:
1062306a36Sopenharmony_ci  * 1. Redistributions of source code must retain the above copyright
1162306a36Sopenharmony_ci  *    notice, this list of conditions, and the following disclaimer,
1262306a36Sopenharmony_ci  *    without modification.
1362306a36Sopenharmony_ci  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1462306a36Sopenharmony_ci  *    substantially similar to the "NO WARRANTY" disclaimer below
1562306a36Sopenharmony_ci  *    ("Disclaimer") and any redistribution must be conditioned upon
1662306a36Sopenharmony_ci  *    including a substantially similar Disclaimer requirement for further
1762306a36Sopenharmony_ci  *    binary redistribution.
1862306a36Sopenharmony_ci  * 3. Neither the names of the above-listed copyright holders nor the names
1962306a36Sopenharmony_ci  *    of any contributors may be used to endorse or promote products derived
2062306a36Sopenharmony_ci  *    from this software without specific prior written permission.
2162306a36Sopenharmony_ci  *
2262306a36Sopenharmony_ci  * Alternatively, this software may be distributed under the terms of the
2362306a36Sopenharmony_ci  * GNU General Public License ("GPL") version 2 as published by the Free
2462306a36Sopenharmony_ci  * Software Foundation.
2562306a36Sopenharmony_ci  *
2662306a36Sopenharmony_ci  * NO WARRANTY
2762306a36Sopenharmony_ci  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2862306a36Sopenharmony_ci  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2962306a36Sopenharmony_ci  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
3062306a36Sopenharmony_ci  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3162306a36Sopenharmony_ci  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3262306a36Sopenharmony_ci  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3362306a36Sopenharmony_ci  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3462306a36Sopenharmony_ci  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3562306a36Sopenharmony_ci  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
3662306a36Sopenharmony_ci  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3762306a36Sopenharmony_ci  * POSSIBILITY OF SUCH DAMAGES.
3862306a36Sopenharmony_ci  *
3962306a36Sopenharmony_ci  */
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#ifndef PM8001_CTL_H_INCLUDED
4262306a36Sopenharmony_ci#define PM8001_CTL_H_INCLUDED
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#define IOCTL_BUF_SIZE		4096
4562306a36Sopenharmony_ci#define HEADER_LEN			28
4662306a36Sopenharmony_ci#define SIZE_OFFSET			16
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci#define BIOSOFFSET			56
4962306a36Sopenharmony_ci#define BIOS_OFFSET_LIMIT		61
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci#define FLASH_OK                        0x000000
5262306a36Sopenharmony_ci#define FAIL_OPEN_BIOS_FILE             0x000100
5362306a36Sopenharmony_ci#define FAIL_FILE_SIZE                  0x000a00
5462306a36Sopenharmony_ci#define FAIL_PARAMETERS                 0x000b00
5562306a36Sopenharmony_ci#define FAIL_OUT_MEMORY                 0x000c00
5662306a36Sopenharmony_ci#define FLASH_IN_PROGRESS               0x001000
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define IB_OB_READ_TIMES                256
5962306a36Sopenharmony_ci#define SYSFS_OFFSET                    1024
6062306a36Sopenharmony_ci#define PM80XX_IB_OB_QUEUE_SIZE         (32 * 1024)
6162306a36Sopenharmony_ci#define PM8001_IB_OB_QUEUE_SIZE         (16 * 1024)
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_cistatic inline u32 pm8001_ctl_aap1_memmap(u8 *ptr, int idx, int off)
6462306a36Sopenharmony_ci{
6562306a36Sopenharmony_ci	return *(u32 *)(ptr + idx * 32 + off);
6662306a36Sopenharmony_ci}
6762306a36Sopenharmony_ci#endif /* PM8001_CTL_H_INCLUDED */
6862306a36Sopenharmony_ci
69