Ytterbium- and chromium-doped fibre laser: from chaotic self-pulsing to passive Q-switching