David Kilroy | f482eb7 | 2008-08-21 23:27:51 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007, David Kilroy |
| 3 | * |
| 4 | * The contents of this file are subject to the Mozilla Public License |
| 5 | * Version 1.1 (the "License"); you may not use this file except in |
| 6 | * compliance with the License. You may obtain a copy of the License |
| 7 | * at http://www.mozilla.org/MPL/ |
| 8 | * |
| 9 | * Software distributed under the License is distributed on an "AS IS" |
| 10 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See |
| 11 | * the License for the specific language governing rights and |
| 12 | * limitations under the License. |
| 13 | * |
| 14 | * Alternatively, the contents of this file may be used under the |
| 15 | * terms of the GNU General Public License version 2 (the "GPL"), in |
| 16 | * which case the provisions of the GPL are applicable instead of the |
| 17 | * above. If you wish to allow the use of your version of this file |
| 18 | * only under the terms of the GPL and not to allow others to use your |
| 19 | * version of this file under the MPL, indicate your decision by |
| 20 | * deleting the provisions above and replace them with the notice and |
| 21 | * other provisions required by the GPL. If you do not delete the |
| 22 | * provisions above, a recipient may use your version of this file |
| 23 | * under either the MPL or the GPL. |
| 24 | */ |
| 25 | #ifndef _HERMES_DLD_H |
| 26 | #define _HERMES_DLD_H |
| 27 | |
| 28 | #include "hermes.h" |
| 29 | |
Pavel Roskin | 933d594 | 2011-07-13 11:19:57 -0400 | [diff] [blame] | 30 | int hermesi_program_init(struct hermes *hw, u32 offset); |
| 31 | int hermesi_program_end(struct hermes *hw); |
| 32 | int hermes_program(struct hermes *hw, const char *first_block, const void *end); |
David Kilroy | f482eb7 | 2008-08-21 23:27:51 +0100 | [diff] [blame] | 33 | |
Pavel Roskin | 933d594 | 2011-07-13 11:19:57 -0400 | [diff] [blame] | 34 | int hermes_read_pda(struct hermes *hw, |
David Kilroy | e233418 | 2008-08-21 23:27:52 +0100 | [diff] [blame] | 35 | __le16 *pda, |
| 36 | u32 pda_addr, |
| 37 | u16 pda_len, |
| 38 | int use_eeprom); |
Pavel Roskin | 933d594 | 2011-07-13 11:19:57 -0400 | [diff] [blame] | 39 | int hermes_apply_pda(struct hermes *hw, |
David Kilroy | e233418 | 2008-08-21 23:27:52 +0100 | [diff] [blame] | 40 | const char *first_pdr, |
David Kilroy | 3faa19c | 2009-02-21 16:52:54 +0000 | [diff] [blame] | 41 | const void *pdr_end, |
| 42 | const __le16 *pda, |
| 43 | const void *pda_end); |
Pavel Roskin | 933d594 | 2011-07-13 11:19:57 -0400 | [diff] [blame] | 44 | int hermes_apply_pda_with_defaults(struct hermes *hw, |
David Kilroy | 8f5ae73 | 2008-08-21 23:27:53 +0100 | [diff] [blame] | 45 | const char *first_pdr, |
David Kilroy | 3faa19c | 2009-02-21 16:52:54 +0000 | [diff] [blame] | 46 | const void *pdr_end, |
| 47 | const __le16 *pda, |
| 48 | const void *pda_end); |
David Kilroy | f482eb7 | 2008-08-21 23:27:51 +0100 | [diff] [blame] | 49 | |
David Kilroy | 3faa19c | 2009-02-21 16:52:54 +0000 | [diff] [blame] | 50 | size_t hermes_blocks_length(const char *first_block, const void *end); |
David Kilroy | f482eb7 | 2008-08-21 23:27:51 +0100 | [diff] [blame] | 51 | |
| 52 | #endif /* _HERMES_DLD_H */ |