Shop OBEX P1 Docs P2 Docs Learn Events
Mailbox details? — Parallax Forums

Mailbox details?

pedwardpedward Posts: 1,642
edited 2013-04-23 09:00 in Propeller 2
Has a consensus on the Mailbox location, size, and format been reached?

I'm working on a few ideas at once and want to get this sorted first.

I'm working on the boot loader, with AES-128 decryption, and I'm working on Ethernet. For the latter I want the driver to use a standard convention for mailbox.

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-22 10:54
    pedward wrote: »
    Has a consensus on the Mailbox location, size, and format been reached?

    I'm working on a few ideas at once and want to get this sorted first.

    I'm working on the boot loader, with AES-128 decryption, and I'm working on Ethernet. For the latter I want the driver to use a standard convention for mailbox.
    Can you say what you're doing with the bootloader. I'm working on a bootloader as well and I'd like to make sure it works with your new AES-128 code.
  • pedwardpedward Posts: 1,642
    edited 2013-04-22 11:17
    David Betz wrote: »
    Can you say what you're doing with the bootloader. I'm working on a bootloader as well and I'd like to make sure it works with your new AES-128 code.

    Refresh :)

    The beauty of disconnecting the bootloader from the ROM, but authenticating it, is that you can have a myriad of different bootloaders to fit your specific need. I'm just trying to fulfill the original vision and offer a standard bearer for launch.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-22 11:23
    David Betz wrote: »
    Can you say what you're doing with the bootloader. I'm working on a bootloader as well and I'd like to make sure it works with your new AES-128 code.
    Okay, I'll post a reply to your real question now. :-)

    I have kept out of the mailbox discussion while I work on a bootloader that could work with whatever other people agree on. Also, I guess there isn't necessarily a need for all P2 programs to follow the same conventions although it would make reusing drivers easier. I was hoping that RossH would participate in this discussion because of his experience with doing something similar in Catalina C but he seems to have disappeared.
  • jazzedjazzed Posts: 11,803
    edited 2013-04-22 13:17
    pedward wrote: »

    Choices:

    1) Use it until you find it doesn't fit your needs, then do something else.
    2) Ignore it and move on.

    I'm curious about your thoughts as to why it such a methodology necessary.
    I understand it can have value, but I can live without it in most cases.

    I'm not trying to start a brawl; I just want to read your opinion because I respect you.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-22 13:19
    jazzed wrote: »
    Choices:

    1) Use it until you find it doesn't fit your needs, then do something else.
    2) Ignore it and move on.

    I'm curious about your thoughts as to why it such a methodology necessary.
    I understand it can have value, but I can live without it in most cases.

    I'm not trying to start a brawl; I just want to read your opinion because I respect you.
    I think the idea is to use a common interface so it is easy to share drivers or substitute one for another.
  • jazzedjazzed Posts: 11,803
    edited 2013-04-22 13:41
    Perry, I see now in the Bootloader thread that you need a long reserved for doing AES. I consider that an entirely valid use of a reserve location for users of that loader. I still think one needs a cookie to indicate that something useful is happening in the lower block of memory.
  • pedwardpedward Posts: 1,642
    edited 2013-04-22 14:46
    I want to make the flash memory space mirror the HUB memory space, so the offsets of locations are identical.

    I propose to do this by putting the start location at $1000, so I can use the lower 4K chunk to hold the bootloader and associated data. This will also facilitate reprogramming the flash without touching the bootloader, which also opens up everything from $20000 on to the program code, having only $1000-$1FFFF tied up with some hard and fast rule.

    I'm simultaneously looking at an Ethernet driver and I want the code to use a mailbox structure to make life easier and make it language agnostic. If the mailbox format listed in the thread referenced has been agreed upon in some semi-official manner, I'm happy to use it.

    The bootloader won't need more than one COG or any reserved space, other than the first flash chunk.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-22 14:54
    pedward wrote: »
    I want to make the flash memory space mirror the HUB memory space, so the offsets of locations are identical.

    I propose to do this by putting the start location at $1000, so I can use the lower 4K chunk to hold the bootloader and associated data. This will also facilitate reprogramming the flash without touching the bootloader, which also opens up everything from $20000 on to the program code, having only $1000-$1FFFF tied up with some hard and fast rule.

    I'm simultaneously looking at an Ethernet driver and I want the code to use a mailbox structure to make life easier and make it language agnostic. If the mailbox format listed in the thread referenced has been agreed upon in some semi-official manner, I'm happy to use it.

    The bootloader won't need more than one COG or any reserved space, other than the first flash chunk.
    I think it's important that the area between $e80 and $1000 get loaded as well as the program above $1000. This is because that area will contain constants like CLKFREQ as well as possibly pre-initialized mailboxes.
  • pedwardpedward Posts: 1,642
    edited 2013-04-22 15:11
    The problem isn't so much the loading, but the programming. The minimum unit is the flash page size, so the bootloader and data need to fall within that modulus.

    I seem to recall that the flash chips are 4K page size? One of the criteria for a field upgrade should be recoverability. Perhaps re-thinking the flash format a little bit in order to accommodate $E80-$FFF and have a recoverable flash section? Perhaps a double buffered image, so when you flash a new image in the field, if something goes wrong it won't switch from the primary to the secondary?

    Sort of like double buffering, just toggle between image locations, or once the secondary has booted it should rewrite the primary?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-22 18:51
    pedward wrote: »
    The problem isn't so much the loading, but the programming. The minimum unit is the flash page size, so the bootloader and data need to fall within that modulus.

    I seem to recall that the flash chips are 4K page size? One of the criteria for a field upgrade should be recoverability. Perhaps re-thinking the flash format a little bit in order to accommodate $E80-$FFF and have a recoverable flash section? Perhaps a double buffered image, so when you flash a new image in the field, if something goes wrong it won't switch from the primary to the secondary?

    Sort of like double buffering, just toggle between image locations, or once the secondary has booted it should rewrite the primary?
    Recovery is only really important if you intend to do field upgrades of the firmware but we should certainly plan for that possiblity. Two copies with a CRC on each so you can figure out if they've been corrupted is probably a good idea.
  • pedwardpedward Posts: 1,642
    edited 2013-04-22 19:16
    I've continued my thoughts in the Bootloader thread.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-23 07:25
    I like the idea of mirroring the flash from $1000 up, with the bootloader below that in the flash; I was thinking along very similar lines.

    I'll check the mailbox thread to make sure its up to date, I think I've been working to the latest posted version; if not I'll update it.

    Glad to have you on-board with the mailboxes :)
    pedward wrote: »
    I want to make the flash memory space mirror the HUB memory space, so the offsets of locations are identical.

    I propose to do this by putting the start location at $1000, so I can use the lower 4K chunk to hold the bootloader and associated data. This will also facilitate reprogramming the flash without touching the bootloader, which also opens up everything from $20000 on to the program code, having only $1000-$1FFFF tied up with some hard and fast rule.

    I'm simultaneously looking at an Ethernet driver and I want the code to use a mailbox structure to make life easier and make it language agnostic. If the mailbox format listed in the thread referenced has been agreed upon in some semi-official manner, I'm happy to use it.

    The bootloader won't need more than one COG or any reserved space, other than the first flash chunk.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-23 07:27
    I like the idea of mirroring the flash from $1000 up, with the bootloader below that in the flash; I was thinking along very similar lines.

    I'll check the mailbox thread to make sure its up to date, I think I've been working to the latest posted version; if not I'll update it.

    Glad to have you on-board with the mailboxes :)
    You and Cluso keep talking about writing drivers to this mailbox spec. Do you have any available yet that we can play with?
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-23 07:59
    Not yet, but I'll be releasing a couple of graphics drivers that use it soon.
    David Betz wrote: »
    You and Cluso keep talking about writing drivers to this mailbox spec. Do you have any available yet that we can play with?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-23 08:12
    Not yet, but I'll be releasing a couple of graphics drivers that use it soon.
    Great! I'm looking forward to playing your graphics drivers!
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-23 08:39
    Thanks!

    If possible, can you post how I can integrate a PASM blob with propgcc? That will help get demos out faster :)

    The limiting gcc to the first 32KB of HUB is not critical for SDRAM graphics drivers, it only matters for the 96KB hub frame buffers I've been using. For smaller hub buffers, I could declare the frame buffer as an integer array, and pass the address through cognew.
    David Betz wrote: »
    Great! I'm looking forward to playing your graphics drivers!
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-23 08:45
    Thanks!

    If possible, can you post how I can integrate a PASM blob with propgcc? That will help get demos out faster :)

    The limiting gcc to the first 32KB of HUB is not critical for SDRAM graphics drivers, it only matters for the 96KB hub frame buffers I've been using. For smaller hub buffers, I could declare the frame buffer as an integer array, and pass the address through cognew.
    For an example of loading a PASM blob look at propgcc/demos/toggle/pasm_toggle.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-04-23 09:00
    Thank you!
    David Betz wrote: »
    for an example of loading a pasm blob look at propgcc/demos/toggle/pasm_toggle.
Sign In or Register to comment.